[JBossWS] - SAP&wsdl from JBoss
by fil78
Hi everybody!
I have got a new task - to implement web services in SAP and in JBoss. So I am trying to implement test service - I implemented one using java and now I try to generate proxy object in SAP from wsdl. Did someone do it? and how?? - Everytime when I push generate button exception appears... Are there any traps?
Here is my wsdl:
<?xml version="1.0" encoding="UTF-8"?>
| <wsdl:definitions name="MyTestService" targetNamespace="http://www.openuri.org/2008/05/HelloWorld" xmlns:tns="http://www.openuri.org/2008/05/HelloWorld" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
| <wsdl:types>
| <xs:schema targetNamespace="http://www.openuri.org/2008/05/HelloWorld" version="1.0" xmlns:tns="http://www.openuri.org/2008/05/HelloWorld" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="MessageDeliverException" type="tns:MessageDeliverException"/>
| <xs:element name="URISyntaxException" type="tns:URISyntaxException"/>
| <xs:complexType name="URISyntaxException">
| <xs:sequence>
| <xs:element name="index" type="xs:int"/>
| <xs:element minOccurs="0" name="input" type="xs:string"/>
| <xs:element minOccurs="0" name="message" type="xs:string"/>
| <xs:element minOccurs="0" name="reason" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="MessageDeliverException">
| <xs:sequence>
| <xs:element minOccurs="0" name="message" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </wsdl:types>
| <wsdl:message name="WSTestBean_getEmployeeName">
| <wsdl:part name="id" type="xsd:string">
| </wsdl:part>
| </wsdl:message>
| <wsdl:message name="MessageDeliverException">
| <wsdl:part name="MessageDeliverException" element="tns:MessageDeliverException">
| </wsdl:part>
| </wsdl:message>
| <wsdl:message name="WSTestBean_getEmployeeNameResponse">
| <wsdl:part name="return" type="xsd:string">
| </wsdl:part>
| </wsdl:message>
| <wsdl:message name="URISyntaxException">
| <wsdl:part name="URISyntaxException" element="tns:URISyntaxException">
| </wsdl:part>
| </wsdl:message>
| <wsdl:portType name="WSTestBean">
| <wsdl:operation name="getEmployeeName" parameterOrder="id">
| <wsdl:input message="tns:WSTestBean_getEmployeeName">
| </wsdl:input>
| <wsdl:output message="tns:WSTestBean_getEmployeeNameResponse">
| </wsdl:output>
| <wsdl:fault name="MessageDeliverException" message="tns:MessageDeliverException">
| </wsdl:fault>
| <wsdl:fault name="URISyntaxException" message="tns:URISyntaxException">
| </wsdl:fault>
| </wsdl:operation>
| </wsdl:portType>
| <wsdl:binding name="WSTestBeanBinding" type="tns:WSTestBean">
| <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
| <wsdl:operation name="getEmployeeName">
| <soap:operation soapAction=""/>
| <wsdl:input>
| <soap:body use="literal" namespace="http://www.openuri.org/2008/05/HelloWorld"/>
| </wsdl:input>
| <wsdl:output>
| <soap:body use="literal" namespace="http://www.openuri.org/2008/05/HelloWorld"/>
| </wsdl:output>
| <wsdl:fault name="MessageDeliverException">
| <soap:fault name="MessageDeliverException" use="literal"/>
| </wsdl:fault>
| <wsdl:fault name="URISyntaxException">
| <soap:fault name="URISyntaxException" use="literal"/>
| </wsdl:fault>
| </wsdl:operation>
| </wsdl:binding>
| <wsdl:service name="MyTestService">
| <wsdl:port name="WSTestBeanPort" binding="tns:WSTestBeanBinding">
| <soap:address location="http://127.0.0.1:8080/WebServiceProject/WSTestBean"/>
| </wsdl:port>
| </wsdl:service>
| </wsdl:definitions>
and here is exception:
Cannot generate proxy (object missing in WSDL, see long text)
| Message no. SPRX084
|
| Background
| During proxy generation, an interface description in WSDL format is fetched from the Integration Builder or from another source and interpreted. This WSDL document must describe the whole interface correctly.
| ==> Display Query
| ==> Display WSDL Document
|
| Diagnosis
| In the WSDL document, the object
| "<message name="WSTestBean_getEmployeeName"> <pa..."
| from the namespace
| "http://www.openuri.org/2008/05/HelloWorld"
| links to the object
| ""
| from the namespace
| ""
|
| However, this last object does not exist in the WSDL document.
| ....
|
Are there any ideas about it? I will be appreciate, thanx a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164467#4164467
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164467
16 years, 5 months
[JBossWS] - How to catch/get known of broken pipe exception within serve
by javaboss2008
Hi developers,
I have created a WS with some WebMethods running on Jboss as an Eclipse Dynamic Web Project. I am doing that with the annotations from javax.jws.*.
Now, it is possible that a method needs some time to reply to a clients call. The client could stop waiting for the reply by setting a timeout value on the WS call like:
client:
// a very short time to test the error
| int timeout = 10; // in ms
|
| // set the timeout property
| Map<String, Object> ctxt = ((BindingProvider)service).getRequestContext();
| ctxt.put(com.sun.xml.internal.ws.client.dispatch.impl.protocol.MessageDispatcherHelper.REQUEST_TIMEOUT, timeout);
|
| // now call the WS method
| result = service.myMethod(number);
If now the client stops waiting for the reply and after some time my serverside method wants to return its result to the client it fails with a java.net.SocketException 'Broken Pipe'. Unfortunately my servermethod finished successfully without getting known of the failed communication. The exception can only be seen in the jboss log.
Is there a common way to get known of the clientside connection reset within my serverside method? Does the WS-Framework provide any concept to manage such a race condition in an elegant way?
Or have u any other ideas on how I could solve my problem? I need to know, that the client has not recieved my result, cause in that case I need to rollback some actions that have been done on server side.
jboss-log4j serverlog:
2008-07-12 20:25:19,546 INFO [myws.MyWebServiceImpl] Webservice called: myMethod(5000001)
| 2008-07-12 20:25:19,766 DEBUG [myws.MyWebServiceImpl] returning result
| 2008-07-12 20:25:19,767 ERROR [org.jboss.ws.core.server.AbstractServiceEndpointServlet] Error processing web service request
| ClientAbortException: java.net.SocketException: Broken pipe
| at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
| at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
| at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:309)
| at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
| at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
| at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:485)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.net.SocketException: Broken pipe
| at java.net.SocketOutputStream.socketWrite0(Native Method)
| at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
| at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
| at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:764)
| at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:124)
| at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:570)
| at org.apache.coyote.Response.doWrite(Response.java:560)
| at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
| ... 27 more
|
Thanks a lot for help.
javaboss2008
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164054#4164054
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164054
16 years, 5 months
[JBossWS] - Re: Schema Validation - Failed to read schema document
by bbucy
Decided to do some debugging. Looks like SOAPBodyElementDoc.validatePayload calls a method (e.g. SchemaExtractor.getSchemaUrl) which extracts the wsdl:types from the WSDL document resulting in a temporary file located at ${JBOSS_ROOT}\server\default\tmp\jbossws. This temporary schema is used for validation. The problem being my import is in the wsdl:types with a SchemaLocation of "WSTest.xsd". WSTest.xsd is no longer in the same directory; thus is not found by parser. If I manual move my WSTest.xsd to the "tmp" directory the transaction goes thru (e.g. schema validation fails; there is a bad pattern facet in my schema).
So I guess my question is, am I defining the SchemaLocation correctly (e.g. SchemaLocation="WSTest.xsd") or does getSchemaUrl need to identify imports and either redefine the location or copy the schema to the "tmp" directory along with extracted wsdl:types schema?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163882#4163882
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163882
16 years, 5 months