I have a legacy app that mixes both CXF and jersey-client.
When I am using the Jersey Client but CXF takes over.
Response response = client
.target("http://example.com")
.register(MultiPartFeature.class) //error when run this line
.request(MediaType.APPLICATION_JSON )accept type
.put(Entity.entity(request, mediaType), Response.class);
When using a jersey client to retrieve multipart from a jersey server, this action is handled by cxf and throw error:
java.lang.RuntimeException: java.lang.InstantiationException: org.glassfish.jersey.media.multipart.internal.FormDataParamValueFactoryProvider
21:09:51,574 INFO [stdout] (default task-31) at org.apache.cxf.jaxrs.impl.ConfigurationImpl.createProvider(ConfigurationImpl.java:208) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5]
21:09:51,574 INFO [stdout] (default task-31) at org.apache.cxf.jaxrs.impl.ConfigurationImpl.register(ConfigurationImpl.java:176) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5]
21:09:51,574 INFO [stdout] (default task-31) at org.apache.cxf.jaxrs.impl.ConfigurableImpl.register(ConfigurableImpl.java:91) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5]
21:09:51,574 INFO [stdout] (default task-31) at org.apache.cxf.jaxrs.impl.ConfigurableImpl.doRegister(ConfigurableImpl.java:117) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5]
21:09:51,574 INFO [stdout] (default task-31) at org.apache.cxf.jaxrs.impl.ConfigurableImpl.register(ConfigurableImpl.java:108) ~[cxf-rt-frontend-jaxrs-3.1.5.jar:3.1.5]
There is an issue
enter link description here
Use JerseyClientBuilder instead of ClientBuilder. The latter will default to using the CXF client. And don't use JerseyClientBuilder.newClient(). That is inherited from ClientBuilder (which JerseyClientBuilder extends), so it has the default behavior previously mentioned about defaulting to using CXF. Use JerseyClientBuilder.createClient() or instantiate the builder, call some methods on it, then call build(). You can look at the source code.
Related
I have some html text inputs which send data to a back-end spring system. When I put just a (%) as a character I am getting the following Exception:
java.lang.IllegalArgumentException: Incomplete escaping sequence in input
14:17:34,269 INFO [stdout] (default task-4) at org.unbescape.uri.UriEscapeUtil.unescape(UriEscapeUtil.java:617)
14:17:34,269 INFO [stdout] (default task-4) at org.unbescape.uri.UriEscape.unescapeUriQueryParam(UriEscape.java:1702)
14:17:34,269 INFO [stdout] (default task-4) at org.unbescape.uri.UriEscape.unescapeUriQueryParam(UriEscape.java:1668)
14:17:34,269 INFO [stdout] (default task-4) at org.thymeleaf.spring5.util.SpringRequestUtils.checkViewNameNotInRequest(SpringRequestUtils.java:55)
14:17:34,269 INFO [stdout] (default task-4) at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:275)
14:17:34,269 INFO [stdout] (default task-4) at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190)
I am encoding the data before is sent to the back-end using JS's encodeURIComponent method and in the link the % becomes %25 which is the correct encoded value but why does it throw an exception and what is the possible solution to this I am out of ideas tbh.
Thank you in advance for your responses :)
You did not disclose more information other than "When I put just a (%) as a character" and "I am encoding the data".
My crystal bulb is telling me there is some http(s) request and one of the request parameters contains an encoded percentage sign only. When this request is parsed by the server the %25 is decoded back into %. So far no problem.
But is it possible that the application now tries to decode the data itself and just sees the % sign? Then it would come back with exactly the error that you see.
In that case you might want to double encode: % -> %25 -> %2525
change your thymeleaf version.
<properties>
<thymeleaf.version>3.0.13.RELEASE</thymeleaf.version>
</properties>
for more information about this bug, you can read about it. hope it will resolve your issue.[Thymeleaf Issue#255]
[1]: https://github.com/thymeleaf/thymeleaf-spring/issues/255
I edit a simple jetty web application using maven. I try to inject the following rule scripts into java.sql.Statement.executeQuery(String).
RULE trace java.sql.Statement.executeQuery enter
INTERFACE ^java.sql.Statement
METHOD executeQuery(String)
AT ENTRY
IF debug("trace executeQuery(String)")
DO traceln("enter executeQuery...")
ENDRULE
RULE trace java.sql.Statement.executeUpdate enter
INTERFACE ^java.sql.Statement
METHOD executeUpdate(String)
AT ENTRY
IF TRUE
DO traceln("entering executeUpdate")
ENDRULE
I install these scripts. This is as follows:
C:\Users\ln13277429609\Desktop\gitcode\git-study\byteman-aop-version2\security_taint_webapp>bmsubmit -l src/main/resources/traceExecuteQuery.
btm
install rule trace java.sql.Statement.executeQuery enter
install rule trace java.sql.Statement.executeUpdate enter
I use mvn jetty:run-forked start this web application. its jvmArgs are as follows:
<jvmArgs>-javaagent:C:\Users\ln13277429609\.m2\repository\org\jboss\byteman\byteman\4.0.16\byteman-4.0.16.jar=listener:true,boot:C:\Users\ln13277429609\.m2\repository\org\jboss\byteman\byteman\4.0.16\byteman-4.0.16.jar -Dorg.jboss.byteman.transform.all -Dorg.jboss.byteman.verbose -Dorg.jboss.byteman.debug</jvmArgs>
When I post a request,a bug happened in the console. Theses log messagens are as follows.
[STDOUT] AccessManager:init Initialising default AccessManager
[STDOUT] TransformListener() : accepting requests on localhost:9091
[STDERR] 2021-08-15 20:49:48.802:INFO::main: Logging initialized #388ms to org.eclipse.jetty.util.log.StdErrLog
[STDERR] 2021-08-15 20:49:48.990:INFO:oejmp.Starter:main: Started Jetty Server
[STDERR] 2021-08-15 20:49:48.990:INFO:oejs.Server:main: jetty-9.4.3.v20170317
[STDERR] 2021-08-15 20:49:49.554:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
[STDERR] 2021-08-15 20:49:49.554:INFO:oejs.session:main: No SessionScavenger set, using defaults
[STDERR] 2021-08-15 20:49:49.554:INFO:oejs.session:main: Scavenging every 660000ms
[STDERR] 2021-08-15 20:49:50.364:INFO:oejsh.ContextHandler:main: Started o.e.j.m.p.JettyWebAppContext#5ba23b66{/taintwebapp,[file:///C:/Users
/ln13277429609/Desktop/gitcode/git-study/byteman-aop-version2/security_taint_webapp/src/main/webapp/],AVAILABLE}
[STDERR] 2021-08-15 20:49:50.396:INFO:oejs.AbstractConnector:main: Started ServerConnector#50a638b5{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[STDOUT] -FQOF8GQQXS5U
[STDERR] 2021-08-15 20:49:50.396:INFO:oejs.Server:main: Started #1978ms
[STDOUT] com.mysql.jdbc.JDBC4Connection#6d234c29
[STDOUT] select * from user where loginname='admin' and password='123' and pin='456'
[STDOUT] TransformListener() : handling connection on port 9091
[STDOUT] retransforming com.mysql.jdbc.PreparedStatement
[STDOUT] retransforming com.mysql.jdbc.StatementImpl
[STDOUT] org.jboss.byteman.agent.Transformer : possible trigger for rule trace java.sql.Statement.executeUpdate enter in class com.mysql.jdbc
.StatementImpl
[STDOUT] RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into com.mysql.jdbc.StatementImpl.executeUpdate(java.lang.String) in
t for rule trace java.sql.Statement.executeUpdate enter
[STDOUT] org.jboss.byteman.agent.Transformer : inserted trigger for trace java.sql.Statement.executeUpdate enter in class com.mysql.jdbc.Stat
ementImpl
[STDOUT] org.jboss.byteman.agent.Transformer : possible trigger for rule trace java.sql.Statement.executeQuery enter in class com.mysql.jdbc.
StatementImpl
[STDOUT] RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into com.mysql.jdbc.StatementImpl.executeQuery(java.lang.String) jav
a.sql.ResultSet for rule trace java.sql.Statement.executeQuery enter
[STDOUT] exits unaccounted for in block B30
[STDOUT] org.jboss.byteman.agent.Transformer : unexpected error injecting trigger for rule trace java.sql.Statement.executeQuery enter into c
lass com.mysql.jdbc.StatementImpl
[STDOUT] java.lang.NullPointerException
[STDOUT] java.lang.NullPointerException
[STDOUT] at org.jboss.byteman.agent.adapter.cfg.CFG.computeContainment(CFG.java:1206)
[STDOUT] at org.jboss.byteman.agent.adapter.cfg.CFG.carryForward(CFG.java:1042)
[STDOUT] at org.jboss.byteman.agent.adapter.cfg.CFG.split(CFG.java:1320)
[STDOUT] at org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter.visitInsn(RuleTriggerMethodAdapter.java:688)
[STDOUT] at org.jboss.byteman.agent.adapter.EntryTriggerAdapter$EntryTriggerMethodAdapter.visitInsn(EntryTriggerAdapter.java:133)
[STDOUT] at org.jboss.byteman.objectweb.asm.tree.InsnNode.accept(InsnNode.java:65)
[STDOUT] at org.jboss.byteman.objectweb.asm.tree.InsnList.accept(InsnList.java:144)
[STDOUT] at org.jboss.byteman.objectweb.asm.tree.MethodNode.accept(MethodNode.java:751)
[STDOUT] at org.jboss.byteman.objectweb.asm.commons.JSRInlinerAdapter.visitEnd(JSRInlinerAdapter.java:158)
[STDOUT] at org.jboss.byteman.objectweb.asm.ClassReader.readMethod(ClassReader.java:1495)
[STDOUT] at org.jboss.byteman.objectweb.asm.ClassReader.accept(ClassReader.java:721)
[STDOUT] at org.jboss.byteman.objectweb.asm.ClassReader.accept(ClassReader.java:401)
[STDOUT] at org.jboss.byteman.agent.TransformContext.transform(TransformContext.java:152)
[STDOUT] at org.jboss.byteman.agent.Transformer.transform(Transformer.java:757)
[STDOUT] at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:824)
[STDOUT] at org.jboss.byteman.agent.Transformer.tryTransform(Transformer.java:796)
[STDOUT] at org.jboss.byteman.agent.Transformer.transform(Transformer.java:302)
[STDOUT] at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
[STDOUT] at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
[STDOUT] at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
[STDOUT] at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
[STDOUT] at org.jboss.byteman.agent.Retransformer.installScript(Retransformer.java:151)
[STDOUT] at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:351)
[STDOUT] at org.jboss.byteman.agent.TransformListener.loadScripts(TransformListener.java:274)
[STDOUT] at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:226)
[STDOUT] at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:156)
[STDOUT] com.mysql.jdbc.JDBC4Connection#51fd5918
[STDOUT] select * from user where loginname='admin' and password='123' and pin='456'
I find some scrips succeding in being injected into java.sql.Statement.executeUpdate,but not for executeQuery. So, how do I solve the problem?
mysql-connector-java-8.0.26.jar,Tomcat 7.0.99,jdk1.8.0_241,byteman 4.0.13 this is my test environment.
I edit a simple java web. I'm happy to solve the problem. I only convert mysql-connector-java-5.0.38.jar to mysql-connector-java-8.0.26.jar to solve the bug. I submit the following rule script:
RULE trace java.sql.Statement.executeQuery enter
INTERFACE ^java.sql.Statement
METHOD executeQuery(String)
AT ENTRY
IF debug("trace executeQuery(String)")
DO traceln("enter executeQuery..."+$1)
ENDRULE
the following log indicates that side effect is injected to executeQuery method.
TransformListener() : handling connection on port 9091
org.jboss.byteman.agent.Transformer : possible trigger for rule trace java.sql.Statement.executeQuery enter in class com.mysql.cj.jdbc.StatementImpl
RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into com.mysql.cj.jdbc.StatementImpl.executeQuery(java.lang.String) java.sql.ResultSet for rule trace java.sql.Statement.executeQuery enter
org.jboss.byteman.agent.Transformer : inserted trigger for trace java.sql.Statement.executeQuery enter in class com.mysql.cj.jdbc.StatementImpl
com.mysql.cj.jdbc.ConnectionImpl#7e00f47b
select * from user where loginname='admin' and password='123' and pin='456'
Rule.execute called for trace java.sql.Statement.executeQuery enter_0:0
HelperManager.install for helper class org.jboss.byteman.rule.helper.Helper
calling activated() for helper class org.jboss.byteman.rule.helper.Helper
Default helper activated
calling installed(trace java.sql.Statement.executeQuery enter) for helper classorg.jboss.byteman.rule.helper.Helper
Installed rule using default helper : trace java.sql.Statement.executeQuery enter
trace java.sql.Statement.executeQuery enter execute
rule.debug{trace java.sql.Statement.executeQuery enter_0:0} : trace executeQuery(String)
enter executeQuery...select * from user where loginname='admin' and password='123' and pin='456'
Although the bug is solved, I think the environment setting is difficult. Of course, I don't know deeply the reason why the bug happends there
Hi guys I have the following problem :
I have a back-end server written in Spring and working with PostgreSQL. At first, all was OK but now my friend created a SQL script for filling the database with test data. And here we go :
19:46:30,253 INFO [stdout] (default task-6) Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "user_pkey"
19:46:30,254 INFO [stdout] (default task-6) Detail: Key (id)=(1) already exists.
19:46:30,254 INFO [stdout] (default task-6) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
19:46:30,254 INFO [stdout] (default task-6) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
19:46:30,254 INFO [stdout] (default task-6) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)
19:46:30,254 INFO [stdout] (default task-6) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
19:46:30,254 INFO [stdout] (default task-6) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
19:46:30,255 INFO [stdout] (default task-6) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149)
19:46:30,255 INFO [stdout] (default task-6) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:124)
19:46:30,255 INFO [stdout] (default task-6) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
19:46:30,256 INFO [stdout] (default task-6) ... 158 more
In that script, we also have some test data for users. And this error is throwing during an attempt to sign up. I understand, this error saying that I cant save user with an existing id to the database. But I actually did not set the id for the user. When I send user to save() method user id = null, and I believe that Hibernate should look at the database or at user_id_sequence and choose last id + 1 for the current saving user. At least it worked like that until we filled our database with the test data. The question is why Hibernate is not choosing (last id + 1) but trying to save a new user with an existing id = 0? Is there any way to solve it?
Id generating strategy :
#Getter
#Setter
#MappedSuperclass
#EqualsAndHashCode
#NoArgsConstructor
#ToString(exclude = {"deleted", "updated"})
public class BaseEntity {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
// ...
}
Hibernate configuration :
datasource.url=**********
datasource.username=**********
datasource.password=**********
datasource.driver=org.postgresql.Driver
hibernate.show_sql=false
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.batch.size=200
hibernate.hbm2ddl.auto=update
Sql script looks like a simple script for filling the database with test data :
INSERT INTO public.country (id, created, deleted, updated, code, name, telephone_prefix, continent_id) VALUES (101, NULL, false, NULL, 'ISR', 'Israel', 972, NULL);
....
Do you specify a an ID for your seeded data script ? If you do and they are positive numbers, you can try changing the ID to negative numbers. If you don't specify the ID you can try specifying the ID and make them negative numbers
my app seems to work correctly, but in the console it throws a lot of StalePageExceptions. I dont know why. How can i debug the cause for this exceptions? What are commons reasons for this Exception?
13:32:29,361 WARN [RequestCycleExtra] (default task-60) ********************************
13:32:29,362 WARN [RequestCycleExtra] (default task-60) Handling the following exception: org.apache.wicket.core.request.mapper.StalePageException
13:32:29,363 WARN [RequestCycleExtra] (default task-60) ********************************
13:32:35,626 WARN [RequestCycleExtra] (default task-64) ********************************
13:32:35,627 WARN [RequestCycleExtra] (default task-64) Handling the following exception: org.apache.wicket.core.request.mapper.StalePageException
I use the lastest Wicket version - 6.18 but i have this forever.
EDIT:
StatementGokListPanel.java
columns.add(new StatementLinkColumn(Model.of("")) {
#Override
public void onClick(IModel<StatementGokCommunity> model, AjaxRequestTarget target) {
ComponentMode componentMode = ComponentMode.EDIT;
MarkupContainer mc = StatementGokListPanel.this.getParent();
GokCommunityStatementPanel panel = new GokCommunityStatementPanel("panel", model.getObject(), componentMode, true);
StatementGokListPanel.this.replaceWith(panel);
target.add(mc);
}
});
The exception is being thrown if you try to use a page instance that has been rendered in another browser tab/window. Since Wicket cannot know whether you have changed the page structure in the other tab it just suppresses the action (e.g. link click, form submit, etc.) and re-renders the page instance with its latest state from the server.
The exception also may happen if you use browser's "View (page) source" functionality.
Is there any way one could get the sample request xml using the wsdl(url) alone?
Here is a sample wsdl: http://www.webservicemart.com/uszip.asmx?WSDL
Sample Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ws="http://webservicemart.com/ws/">
<soapenv:Header/>
<soapenv:Body>
<ws:ValidateZip>
<!--Optional:-->
<ws:ZipCode>?</ws:ZipCode>
</ws:ValidateZip>
</soapenv:Body>
</soapenv:Envelope>
I know there are tools out there like SOAPUI and others which could do this. But is there any other way without using these tools once could achieve it using java?
Using wsimport would be one option that would get me the java source, this is more static. Is there a dynamic way to do this?
Exception encountered:
18:57:59,677 WARN [SoapUI] Missing folder [D:\TestAutomation\Z_ZZLastResort\.\ext] for external libraries
18:57:59,920 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\mike\soapui-settings.xml]
Progress: 1 - Caching Definition from url [http://www.webservicemart.com/uszip.asmx?WSDL]
18:58:00,587 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/xop.xsd with targetNamespace http://www.w3.org/2004/08/xop/include
18:58:00,625 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/XMLSchema.xsd with targetNamespace http://www.w3.org/2001/XMLSchema
18:58:00,627 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/xml.xsd with targetNamespace http://www.w3.org/XML/1998/namespace
18:58:00,628 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/swaref.xsd with targetNamespace http://ws-i.org/profiles/basic/1.1/xsd
18:58:00,629 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/xmime200505.xsd with targetNamespace http://www.w3.org/2005/05/xmlmime
18:58:00,637 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/xmime200411.xsd with targetNamespace http://www.w3.org/2004/11/xmlmime
18:58:00,638 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/soapEnvelope.xsd with targetNamespace http://schemas.xmlsoap.org/soap/envelope/
18:58:00,641 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/soapEncoding.xsd with targetNamespace http://schemas.xmlsoap.org/soap/encoding/
18:58:00,643 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/soapEnvelope12.xsd with targetNamespace http://www.w3.org/2003/05/soap-envelope
18:58:00,645 INFO [SchemaUtils] Added default schema from file:/C:/Users/mike/Desktop/soapui-4.5.1-SNAPSHOT.jar!/com/eviware/soapui/resources/xsds/soapEncoding12.xsd with targetNamespace http://www.w3.org/2003/05/soap-encoding
Progress: 2 - Loading [http://www.webservicemart.com/uszip.asmx?WSDL]
18:58:00,648 DEBUG [WsdlLoader] Getting wsdl component from [http://www.webservicemart.com/uszip.asmx?WSDL]
18:58:01,073 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
18:58:01,074 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /uszip.asmx?WSDL HTTP/1.1
18:58:01,314 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection closed
18:58:01,314 DEBUG [HttpClientSupport$SoapUIHttpClient] Closing the connection.
18:58:01,314 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection closed
18:58:01,314 INFO [HttpClientSupport$SoapUIHttpClient] I/O exception (java.net.SocketException) caught when processing request: Connection reset
18:58:01,316 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doReceiveResponse(HttpClientSupport.java:133)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlWsdlLoader$LoaderWorker.construct(UrlWsdlLoader.java:226)
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlWsdlLoader.load(UrlWsdlLoader.java:138)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.loadXmlObject(WsdlLoader.java:121)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:535)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:524)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionCache.update(AbstractDefinitionCache.java:97)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:226)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
18:58:01,319 INFO [HttpClientSupport$SoapUIHttpClient] Retrying request
18:58:01,319 DEBUG [HttpClientSupport$SoapUIHttpClient] Reopening the direct connection.
18:58:01,602 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 2 to execute request
18:58:01,602 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /uszip.asmx?WSDL HTTP/1.1
18:58:02,200 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
18:58:02,210 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
Progress: 1 - Loading Definition from url
18:58:02,260 DEBUG [AbstractDefinitionContext] Loading Definition...
18:58:02,277 DEBUG [WsdlInterfaceDefinition] Loading WSDL: http://www.webservicemart.com/uszip.asmx?WSDL
18:58:02,277 DEBUG [AbstractWsdlDefinitionLoader] Returning baseInputSource [http://www.webservicemart.com/uszip.asmx?WSDL]
Retrieving document at 'http://www.webservicemart.com/uszip.asmx?WSDL'.
18:58:02,347 INFO [SchemaUtils] Loading schema types from [http://www.webservicemart.com/uszip.asmx?WSDL]
18:58:02,347 INFO [SchemaUtils] Getting schema http://www.webservicemart.com/uszip.asmx?WSDL
18:58:02,357 ERROR [SoapUI] An error occured [org.apache.xmlbeans.impl.xb.xsdschema.impl.SchemaDocumentImpl], see error log for details
java.lang.ArrayStoreException: org.apache.xmlbeans.impl.xb.xsdschema.impl.SchemaDocumentImpl
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:418)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:327)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:192)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
18:58:02,359 ERROR [SoapUI] An error occured [com.eviware.soapui.impl.wsdl.support.xsd.SchemaException], see error log for details
com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:512)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:327)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:192)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
18:58:02,360 ERROR [SoapUI] An error occured [com.eviware.soapui.impl.wsdl.support.xsd.SchemaException], see error log for details
com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:512)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getSchemas(SchemaUtils.java:327)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:192)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
18:58:02,363 ERROR [AbstractDefinitionContext] Error loading schema types from http://www.webservicemart.com/uszip.asmx?WSDL, see log for details
18:58:35,061 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection closed
SOAPUI also provide java API to create request/response
public class SOAPInputGenerator {
public static void main(String[] args) throws Exception {
WsdlProject project = new WsdlProject();
WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, "http://localhost:7000/Solicitud?wsdl");
WsdlInterface wsdl = wsdls[0];
for (Operation operation : wsdl.getOperationList()) {
WsdlOperation wsdlOperation = (WsdlOperation) operation;
System.out.println("OP:"+wsdlOperation.getName());
System.out.println("Request:");
System.out.println(wsdlOperation.createRequest(true));
System.out.println("Response:");
System.out.println(wsdlOperation.createResponse(true));
}
}
}
JAR location for SOAP UI libraries
http://www.soapui.org/repository/eviware/jars/
If you don't want use SOAPUI directly , you may find reficio which would be very useful.
Subset of SoapUI library API with example can be find here
https://github.com/reficio/soap-ws
http://www.reficio.org/projects/
This is an open-source project to support SOAP in a purely XML way in Java
You can create the client side stubs using wsimport tool and use jaxb to convert your request object to SOAP xml.