[JBossWS] - Re: Binding exception - prefix
by alesj
This is my wsdl
| <wsdl:definitions name="SimpleServiceImpl" targetNamespace="http://www.themindelectric.com/wsdl/SimpleServiceImpl/">
|
| <wsdl:types>
|
| <xsd:schema targetNamespace="http://www.themindelectric.com/package/com.generalynx.common.interfaces/">
|
| <xsd:complexType name="SimpleOutData">
|
| <xsd:all>
| <xsd:element name="response" nillable="true" type="xsd:string"/>
| </xsd:all>
| </xsd:complexType>
|
| <xsd:complexType name="SimpleInData">
|
| <xsd:all>
| <xsd:element name="date" type="xsd:dateTime"/>
| </xsd:all>
| </xsd:complexType>
| </xsd:schema>
|
| <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.themindelectric.com/wsdl/SimpleServiceImpl/">
| <xsd:import namespace="http://www.themindelectric.com/package/com.generalynx.common.interfaces/"/>
|
| <xsd:element name="getHelloWorld">
|
| <xsd:complexType>
|
| <xsd:sequence>
| <xsd:element name="inData" type="n11:SimpleInData"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:element>
|
| <xsd:element name="getHelloWorldResponse">
|
| <xsd:complexType>
|
| <xsd:sequence>
| <xsd:element name="Result" type="n11:SimpleOutData"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:element>
| </xsd:schema>
| </wsdl:types>
|
| <wsdl:message name="getHelloWorld0In">
| <wsdl:part name="parameters" element="tns:getHelloWorld"/>
| </wsdl:message>
|
| <wsdl:message name="getHelloWorld0Out">
| <wsdl:part name="parameters" element="tns:getHelloWorldResponse"/>
| </wsdl:message>
|
| <wsdl:portType name="SimpleService">
|
| <wsdl:operation name="getHelloWorld" parameterOrder="inData">
| <wsdl:input name="getHelloWorld0In" message="tns:getHelloWorld0In"/>
| <wsdl:output name="getHelloWorld0Out" message="tns:getHelloWorld0Out"/>
| </wsdl:operation>
| </wsdl:portType>
|
| <wsdl:binding name="SimpleService" type="tns:SimpleService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
| <wsdl:operation name="getHelloWorld">
| <soap:operation soapAction="getHelloWorld" style="document"/>
|
| <wsdl:input name="getHelloWorld0In">
| <soap:body use="literal"/>
| </wsdl:input>
|
| <wsdl:output name="getHelloWorld0Out">
| <soap:body use="literal"/>
| </wsdl:output>
| </wsdl:operation>
| </wsdl:binding>
|
| <wsdl:service name="SimpleServiceImpl">
|
| <wsdl:documentation>
| instance of class com.generalynx.gema.services.impl.SimpleServiceImpl
| </wsdl:documentation>
|
| <wsdl:port name="SimpleService" binding="tns:SimpleService">
| <soap:address location="http://sokolov:8081/gema/services/SimpleService"/>
| </wsdl:port>
| </wsdl:service>
| </wsdl:definitions>
|
And my ws client definition looks like this:
| @WebServiceClient(
| name = "SimpleServiceImpl",
| targetNamespace = "http://www.themindelectric.com/wsdl/SimpleServiceImpl/",
| wsdlLocation = "http://sokolov:8081/gema/services/SimpleService.wsdl"
| )
| public class SimpleServiceImpl extends javax.xml.ws.Service {
|
| public SimpleServiceImpl() throws MalformedURLException {
| this(
| new URL("http://sokolov:8081/gema/services/SimpleService.wsdl"),
| new QName("http://www.themindelectric.com/wsdl/SimpleServiceImpl/", "SimpleServiceImpl")
| );
| }
|
| public SimpleServiceImpl(URL url, QName qName) {
| super(url, qName);
| }
|
| @WebEndpoint(name = "SimplePort")
| public SimpleService getSimplePort() {
| return (SimpleService) super.getPort(
| new QName("http://www.themindelectric.com/wsdl/SimpleServiceImpl/", "SimpleService"),
| SimpleService.class);
| }
|
| }
|
|
| @WebService
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| public interface SimpleService {
|
| @WebMethod
| @WebResult(name = "getHelloWorldResponse", targetNamespace = "http://www.themindelectric.com/wsdl/SimpleServiceImpl/")
| SimpleOutData getHelloWorld(
| @WebParam(name = "getHelloWorld", targetNamespace = "http://www.themindelectric.com/wsdl/SimpleServiceImpl/")
| SimpleInData data
| );
|
| }
|
Is this a valid client invocation / request?
| Outgoing SOAPMessage
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <ns1:getHelloWorld xmlns:ns1='http://www.themindelectric.com/wsdl/SimpleServiceImpl/'>
| <date>2006-11-03T16:04:00.015+01:00</date>
| </ns1:getHelloWorld>
| </env:Body>
| </env:Envelope>
|
I get this response, but I get a null result object.
| @SuppressWarnings({"EJB_ERROR"})
| public class ClientTesterJob implements Job {
|
| @WebServiceRef(SimpleServiceImpl.class)
| private SimpleService simpleService;
|
| public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
| System.out.println(simpleService != null);
| SimpleInData data = new SimpleInData();
| data.setDate(new Date());
| System.out.println(simpleService.getHelloWorld(data));
| }
|
| }
|
|
| Incoming Response SOAPMessage
| <soap:Envelope xmlns:n3='http://www.themindelectric.com/package/com.generalynx.common.interfaces/' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <soap:Header/>
| <soap:Body>
| <n:getHelloWorldResponse xmlns:n='http://www.themindelectric.com/wsdl/SimpleServiceImpl/'>
| <n:Result xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:type='n3:SimpleOutData'>
| <response xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:type='xsd:string'>Hello world null</response>
| </n:Result>
| </n:getHelloWorldResponse>
| </soap:Body>
| </soap:Envelope>
I also get a null parameter object on the service side.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982996#3982996
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982996
18 years, 4 months
[JBossWS] - Problem with SAAJ Client for Webservice that receives attach
by RomeuFigueira
Hi there, I've implemented a webservice (JSR-109) that receives two parameters and one attachment. It's working fine, testing with soapui 1.6 beta2 showed that my service could receive and store attachments without a problem.
Now I wanted to create a SAAJ client to make contact with such webservice. I have previous experience developing clients without the attachment part, but in this one I'm having problems.
I've based my client on this one http://labs.jboss.com/portal/jbossws/user-guide/en/html/attachments.html
but when interacting with the webservice, I keep on getting this message:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <faultcode>env:Client</faultcode>
| <faultstring>multipart/related type specified a root type other than the one that was found.</faultstring>
| </env:Fault>
| </env:Body>
| </env:Envelope>
This is my request message via soapUI
| ------=_Part_1_20574010.1162549201841
| Content-Type: text/xml; charset=UTF-8
| Content-Transfer-Encoding: 8bit
| Content-ID: <rootpart(a)soapui.org>
|
| <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:.mediation">
| <soapenv:Header/>
| <soapenv:Body>
| <urn:depositAttach>
| <id_lote>5</id_lote>
| <file_name>text</file_name>
| </urn:depositAttach>
| </soapenv:Body>
| </soapenv:Envelope>
| ------=_Part_1_20574010.1162549201841
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Content-ID: <mimepart=1788743063992(a)soapui.org>
|
| Text message here
| ------=_Part_1_20574010.1162549201841--
|
And this is my message via my SAAJ client
| ------=_Part_0_12285029.1162549416820
| Content-Type: text/xml; charset=utf-8
|
| <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:mediation">
| <SOAP-ENV:Header/>
| <SOAP-ENV:Body>
| <urn:depositAttach>
| <id_lote>1</id_lote>
| <file_name>text</file_name>
| </urn:depositAttach>
| </SOAP-ENV:Body>
| </SOAP-ENV:Envelope>
| ------=_Part_0_12285029.1162549416820
| Content-Type: multipart/mixed;
| boundary="----=_Part_0_28470003.1162549416710"
| Content-ID: <mimepart=1876756521231(a)example.com>
|
| ------=_Part_0_28470003.1162549416710
| Content-Type: text/plain
|
| Text message here
| ------=_Part_0_28470003.1162549416710--
|
| ------=_Part_0_12285029.1162549416820--
|
Additionaly, here is the header of the SOAP transmission from soapUI
| SOAPAction: ""
| Content-Type: multipart/related; type="text/xml";
| start="<rootpart(a)soapui.org>";
| boundary="----=_Part_1_20574010.1162549201841
| MIME-Version: 1.0
| User-Agent: Jakarta Commons-HttpClient/3.0.1
| Host: localhost:8080
| Content-Length: 697
|
Now, here's my problem, I know that the messages are correct, as you can also see, but there must be something wrong with my definiton of attachment. I cannot reproduce the part highlighted in the soapui message, and think that is where my problem lays. Somewere in server process, when the message goes through my client, it can't split the message into two, the Body Part and the Attachment part, and complains when it finds a "text/plain" instead of "text/xml".
Can you help me here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982915#3982915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982915
18 years, 4 months
[JBossWS] - JBossXSErrorHandler: cannot resolve XSD name when loading JS
by dma_k
Hello all!
Has anybody succeeded to deploy a JSR-181 EJB Endpoint, created by https://jax-ws.dev.java.net/?
I am trying to use JAX-WS 2.0 with JbossWS 1.0.3. I have done the following:
- Launched jboss-4.0.5.GA + jboss-EJB-3.0_RC9-FD + jbossws-1.0.3.GA.
- Generated all JAXB entities + ..PortType.java interface + ..Service.java class using the wsimport as written in https://jax-ws.dev.java.net/nonav/jax-ws-21-ea2/docs/UsersGuide.html#3.1.....
- Implemented ..PortType.java (..PortTypeImpl.java) and turned it to JSR-181 EJB Endpoint:
// Standard EJB3 annotations:
| @Local(..LocalInterface.class)
| @Stateless
| // Standard JSR181 annotations:
| @WebService(name = "..PortType", wsdlLocation="META-INF/wsdl/Search.wsdl", targetNamespace = "https://webservices.dot.com/services")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| // JBoss propriatary annotations:
| @PortComponent(contextRoot = "/service/search", urlPattern = "/*")
| @LocalBinding(jndiBinding = "/ejb3/MyBean")
| public class ..PortTypeImpl
| implements ..LocalInterface, ..PortType
| {
| // EJB local interface:
| public SearchRS doHotelSearch(SearchRQ request)
| {
| return null;
| }
|
| @WebMethod
| public SearchRS doHotelSearch(Holder<MessageHeader> ebHeader,
| Holder<Security> wsseHeader, SearchRQ bodyRQ)
| {
| return null;
| }
|
| @WebMethod
| public InfoRS getHotelDescriptiveInfo(Holder<MessageHeader> ebHeader,
| Holder<Security> wsseHeader, InfoRQ bodyRQ)
| {
| return null;
| }
| }
And when deploying it I have a lot of errors like this:
02 16:02:18 ERROR [ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_www.opentravel.org_OTA_2003_0544098.xsd[domain:http://www.w3.org/... resolve the name 'OTA_PayloadStdAttributes' to a(n) 'attribute group' component.
| 02 16:02:18 ERROR [ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_www.opentravel.org_OTA_2003_0544098.xsd[domain:http://www.w3.org/... valid-content.1]::Message=s4s-elt-invalid-content.1: The content of '#AnonType_OTA_HotelDescriptiveInfoRS' is invalid. Element 'attributeGroup' is invalid, misplaced, or occurs too often.
| ...
| org.jboss.ws.WSException: Cannot load schema: [file:/usr/local/jboss-4.0.5.GA/server/default/tmp/jbossws/JBossWS_www.opentravel.org_OTA_2003_0544099.xsd, file:/usr/local/jboss-4.0.5.GA/server/default/tmp/jbossws/JBossWS_schemas.xmlsoap.org_ws_2002_12_secext44092.xsd, file:/usr/local/jboss-4.0.5.GA/server/default/tmp/jbossws/JBossWS_schemas.xmlsoap.org_soap_envelope_44094.xsd, file:/usr/local/jboss-4.0.5.GA/server/default/tmp/jbossws/JBossWS_www.ebxml.org_namespaces_messageHeader44090.xsd]
| at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:172)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:227)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:118)
| at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:145)
Is it possible at all? Any ideas?
Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982888#3982888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982888
18 years, 4 months
[JBossWS] - jaxrpc interop
by zurchman
I have a recalcitrant client that seems to insist on stripping the Namespace from the rpc request.
I'm testing the JBossWS 1.0.3 rpcstyle sample.
When deployed on Tomcat, the service does not seem to care about the missing namespace. JBossWS throws a SOAP Fault.
I'm afraid I'm not familiar with the intricacies of method dispatching.
Is there any way to redeploy this service on JBossWS so that it can tolerate this missing namespace?
Here's a request from soapui, which includes xmlns:rpc and returns a valid response:
| 2006-11-02 14:24:19,597 DEBUG [jbossws.SOAPMessage] Incomming SOAPMessage
| <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
| xmlns:rpc='http://org.jboss.ws/samples/rpcstyle'>
| <soapenv:Header/>
| <soapenv:Body>
| <rpc:purchase>
| <String_1 xmlns=''>Hello</String_1>
| <String_2 xmlns=''>There</String_2>
| </rpc:purchase></soapenv:Body></soapenv:Envelope>
| 2006-11-02 14:24:19,598 DEBUG [org.jboss.ws.soap.SOAPMessageDispatcher] getDispatchDestination: {http://org.jboss.ws/samples/rpcstyle}purchase
|
And here's the request from the careless client, which results in an Exception:
2006-11-02 14:24:45,217 DEBUG [org.jboss.ws.server.StandardEndpointServlet] doPost: /jbossws-samples-rpcstyle
| 2006-11-02 14:24:45,217 DEBUG [org.jboss.ws.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.soap.SOAPMessageContextImpl@bd0da3
| 2006-11-02 14:24:45,218 DEBUG [org.jboss.ws.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=jbossws-samples-rpcstyle,endpoint=TrivialEndpoint
| 2006-11-02 14:24:45,219 DEBUG [org.jboss.ws.soap.MessageFactoryImpl] createMessage: [contentType=text/xml]
| 2006-11-02 14:24:45,220 DEBUG [org.jboss.ws.soap.SOAPContentElement] setXMLFragment: <String_1 xmlns=''>Kermit</String_1>
| 2006-11-02 14:24:45,221 DEBUG [org.jboss.ws.soap.SOAPContentElement] setXMLFragment: <String_2 xmlns=''>Ferrari</String_2>
| 2006-11-02 14:24:45,221 DEBUG [jbossws.SOAPMessage] Incomming SOAPMessage
|
| <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
| <SOAP-ENV:Header/>
| <SOAP-ENV:Body>
| <purchase>
| <String_1 xmlns=''>Kermit</String_1>
| <String_2 xmlns=''>Ferrari</String_2>
| </purchase></SOAP-ENV:Body>
| </SOAP-ENV:Envelope>
| 2006-11-02 14:24:45,221 DEBUG [org.jboss.ws.soap.SOAPMessageDispatcher] getDispatchDestination: null
| 2006-11-02 14:24:45,222 DEBUG [org.jboss.ws.soap.SOAPMessageDispatcher] getDispatchDestination: null
| 2006-11-02 14:24:45,222 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=Endpoint {http://org.jboss.ws/samples/rpcstyle}TrivialServicePort does not contain operation meta data for: purchase,actor=null,detail=null]
| 2006-11-02 14:24:45,222 ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
| javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://org.jboss.ws/samples/rpcstyle}TrivialServicePort does not contain operation meta data for: purchase
| at org.jboss.ws.server.ServiceEndpointInvoker.getDispatchDestination
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982812#3982812
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982812
18 years, 4 months