OK the endpoint interface generated was containing an empty targetNamespace = "" in the annotations; fixed that and advanced with the client (after fixed the targetNamespace at least the schema is correct in the wsdl and it doesn't contain extra characters). Now I run into another issue described very well by Tomek Sztelak here: http://osdir.com/ml/java.xfire.user/2006-10/msg00042.html Now I got a part of the service running, I can see the outgoing soap message which is correct, but now I run into the following exception: ---------------------------------------------------------------------------- Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage (Soap11FaultSerializer.java:31) at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage (SoapFaultSerializer.java:28) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault (ReadHeadersHandler.java:111) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke (ReadHeadersHandler.java:67) at org.codehaus.xfire.handler.HandlerPipeline.invoke (HandlerPipeline.java:131) at org.codehaus.xfire.client.Client.onReceive(Client.java:382) at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient (HttpChannel.java:139) at org.codehaus.xfire.transport.http.HttpChannel.send (HttpChannel.java:48) at org.codehaus.xfire.handler.OutMessageSender.invoke (OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke (HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) at org.codehaus.xfire.client.Client.invoke(Client.java:335) at org.codehaus.xfire.client.XFireProxy.handleRequest (XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy12.putDeviceStatus(Unknown Source) at lixar.ServiceClient.main(ServiceClient.java:513) ---------------------------------------------------------------------------- I made sure I have the same style/use settings on both sides, but I still run into this error and I don't know why ? Can somebody help?
On Tue, 2007-08-05 at 12:02 -0400, Dragos Pavel wrote: > Hi All, > > My conclusion after serious investigations is the following: there is a > bug in the "Top-Down" development of web services. Why can I afirm that: > because I took a simple web service (of type Hello Web Service, meaning > that it just has one method taking a string and returning another > string) and I developed it using both ways "Bottom-Up" and "Top-Down". > First the bottom-up works fine and here is the source code for that > wsdl: > [code]--------------------------------------------------------------------- > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions targetNamespace="http://test_mod_jk" > xmlns:tns="http://test_mod_jk" > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" > xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <wsdl:types> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://test_mod_jk"> > <xsd:element name="testModJKConnection"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" > type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > <xsd:element name="testModJKConnectionResponse"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" > type="xsd:string"/> > </xsd:sequence> > > </xsd:complexType> > </xsd:element> > </xsd:schema> > </wsdl:types> > <wsdl:message name="testModJKConnectionRequest"> > <wsdl:part name="parameters" element="tns:testModJKConnection"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="testModJKConnectionResponse"> > <wsdl:part name="parameters" > element="tns:testModJKConnectionResponse"> > > </wsdl:part> > </wsdl:message> > <wsdl:portType name="TestModJKPortType"> > <wsdl:operation name="testModJKConnection"> > <wsdl:input name="testModJKConnectionRequest" > message="tns:testModJKConnectionRequest"> > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse" > message="tns:testModJKConnectionResponse"> > </wsdl:output> > </wsdl:operation> > > </wsdl:portType> > <wsdl:binding name="TestModJKHttpBinding" > type="tns:TestModJKPortType"> > <wsdlsoap:binding style="document" > transport="http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="testModJKConnection"> > <wsdlsoap:operation soapAction=""/> > <wsdl:input name="testModJKConnectionRequest"> > <wsdlsoap:body use="literal"/> > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse"> > > <wsdlsoap:body use="literal"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="TestModJK"> > <wsdl:port name="TestModJKHttpPort" > binding="tns:TestModJKHttpBinding"> > <wsdlsoap:address location="http://dddpavel- > lnx.dynadocs.com:8080/ws/services/TestModJK"/> > </wsdl:port> > </wsdl:service> > > </wsdl:definitions> > [/code]--------------------------------------------------------------------- > As you can observe the "wsdl:definitions" doesn't contain any > "xmlns:ns1". > > Now I took this wsdl which is correct and tried to implement the exact > same web service in the "Top-Down" manner. So it created for me the > related artifacts, then I implemented the test-client and the service- > implementation class for this same simple web service. I packaged and > deployed the war and here is the wsdl included in the war: > [code]--------------------------------------------------------------------- > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions targetNamespace="http://dddpavel- > lnx.dynadocs.com:8080/energymdm/TestModJK?wsdl" > xmlns:tns="http://dddpavel-lnx.dynadocs.com:8080/energymdm/TestModJK? > wsdl" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <wsdl:types> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://dddpavel- > lnx.dynadocs.com:8080/energymdm/TestModJK?wsdl"> > <xsd:element name="testModJKConnection"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" > type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > <xsd:element name="testModJKConnectionResponse"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" > type="xsd:string"/> > </xsd:sequence> > > </xsd:complexType> > </xsd:element> > </xsd:schema> > </wsdl:types> > <wsdl:message name="testModJKConnectionRequest"> > <wsdl:part name="parameters" element="tns:testModJKConnection"> > </wsdl:part> > </wsdl:message> > <wsdl:message name="testModJKConnectionResponse"> > <wsdl:part name="parameters" > element="tns:testModJKConnectionResponse"> > > </wsdl:part> > </wsdl:message> > <wsdl:portType name="TestModJKPortType"> > <wsdl:operation name="testModJKConnection"> > <wsdl:input name="testModJKConnectionRequest" > message="tns:testModJKConnectionRequest"> > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse" > message="tns:testModJKConnectionResponse"> > </wsdl:output> > </wsdl:operation> > > </wsdl:portType> > <wsdl:binding name="TestModJKHttpBinding" > type="tns:TestModJKPortType"> > <wsdlsoap:binding style="document" > transport="http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="testModJKConnection"> > <wsdlsoap:operation soapAction=""/> > <wsdl:input name="testModJKConnectionRequest"> > <wsdlsoap:body use="literal"/> > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse"> > > <wsdlsoap:body use="literal"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="TestModJK"> > <wsdl:port name="TestModJKHttpPort" > binding="tns:TestModJKHttpBinding"> > <wsdlsoap:address location="http://dddpavel- > lnx.dynadocs.com:8080/ws/services/TestModJK"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > [/code]--------------------------------------------------------------------- > As you can see at this moment the wsdl is correct (doesn't contain bad > formatting and ns1). > > After I start the JBoss AS and access the wsdl url location I get this > wsdl source code: > [code]--------------------------------------------------------------------- > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions targetNamespace=" > > http://dddpavel-lnx.dynadocs.com:8080/energymdm/TestModJK?wsdl > " xmlns:tns=" > > http://dddpavel-lnx.dynadocs.com:8080/energymdm/TestModJK?wsdl > " xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" > xmlns:ns1="http://dddpavel-lnx.dynadocs.com:8080/energymdm/TestModJK? > wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" > xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > <wsdl:types> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://dddpavel- > lnx.dynadocs.com:8080/energymdm/TestModJK?wsdl"> > <xsd:element name="in0" type="xsd:string"/> > <xsd:element name="out" type="xsd:string"/> > </xsd:schema> > </wsdl:types> > <wsdl:message name="testModJKConnectionResponse"> > <wsdl:part name="out" element="ns1:out"> > </wsdl:part> > </wsdl:message> > > <wsdl:message name="testModJKConnectionRequest"> > <wsdl:part name="in0" element="ns1:in0"> > </wsdl:part> > </wsdl:message> > <wsdl:portType name="TestModJKPortType"> > <wsdl:operation name="testModJKConnection"> > <wsdl:input name="testModJKConnectionRequest" > message="tns:testModJKConnectionRequest"> > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse" > message="tns:testModJKConnectionResponse"> > > </wsdl:output> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="TestModJKHttpBinding" > type="tns:TestModJKPortType"> > <wsdlsoap:binding style="document" > transport="http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="testModJKConnection"> > <wsdlsoap:operation soapAction=""/> > <wsdl:input name="testModJKConnectionRequest"> > <wsdlsoap:body use="literal"/> > > </wsdl:input> > <wsdl:output name="testModJKConnectionResponse"> > <wsdlsoap:body use="literal"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="TestModJK"> > <wsdl:port name="TestModJKHttpPort" > binding="tns:TestModJKHttpBinding"> > <wsdlsoap:address location="http://dddpavel- > lnx.dynadocs.com:8080/energymdm/TestModJK"/> > > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > [/code]--------------------------------------------------------------------- > As you can observe the "wsdl:definitions" tag contains again the bad > formatting and the "xmlns:ns1" when the original wsdl file from the > deployed war doesn't contain any of these! > I introduced all the wsdl source code to clarify and exemplify this > issue/bug when one develops "Top-Down" web services. > > In the end when I run the test client of course I get into the same > error: > [quote]--------------------------------------------------------------------- > 8-May-2007 11:33:12 AM org.codehaus.xfire.transport.http.HttpChannel > sendViaClient > SEVERE: Server returned error code = 404 for URI : http://dddpavel- > lnx.dynadocs.com:8080/ws/services/TestModJK. Check server logs for > details > Exception from TestModJKClient: Could not invoke service.. Nested > exception is org.codehaus.xfire.fault.XFireFault: Server returned error > code = 404 for URI : http://dddpavel- > lnx.dynadocs.com:8080/ws/services/TestModJK. Check server logs for > details > [/quote]--------------------------------------------------------------------- > But I still can access that URI that is complaining about, that way I > was able to see the source code for the wrong wsdl in the top-down > design development. > > What I will try right now is to recreate my service in the bottom-up > design (because this is proved to work for me), but I will really > appreciate if you can help me find the reason for that issue/bug in the > top-down development. > Before to recreate all I would appreciate a fast answer regarding this > issue, thanks in advance. > > > > > On Mon, 2007-07-05 at 19:08 -0400, Dragos Pavel wrote: > > Once again I investigated and tried to fix this issue but wasn't > > successful. I was thinking that the ascii characters in the > > targetNamespace (see " 			" before and after the url) from > > the "xsd:schema" tag (when viewing the page source for the wsdl) are > > coming because I formatted with MyEclipse the wsdl source file that I > > created; so I created from scratch another web service project using the > > following wsdl source (with "wsdl:definitions" in one line this time): > > ------------------------------------------------------------- > > <?xml version="1.0" encoding="UTF-8"?> > > <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > > xmlns:tns="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service" > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > targetNamespace="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service"> > > <wsdl:types> > > <xsd:schema targetNamespace="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service"> > > <xsd:element name="PutDeviceStatus"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element minOccurs="0" maxOccurs="1" name="User" type="xsd:string"/> > > <xsd:element minOccurs="0" maxOccurs="1" name="Password" > > type="xsd:string"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="DeviceStatusMessageDoc" > > nillable="true" type="tns:DeviceStatusMessageDoc"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > <xsd:complexType name="DeviceStatusMessageDoc"> > > <xsd:sequence> > > <xsd:element minOccurs="1" maxOccurs="1" name="CreationDate" > > type="xsd:dateTime"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="SequenceNumber" > > type="xsd:string"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="Version" > > type="xsd:string"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="Devices" > > type="tns:ArrayOfDevices"/> > > </xsd:sequence> > > </xsd:complexType> > > <xsd:complexType name="ArrayOfDevices"> > > <xsd:sequence> > > <xsd:element minOccurs="0" maxOccurs="unbounded" name="Device" > > nillable="true" type="tns:Device"/> > > </xsd:sequence> > > </xsd:complexType> > > <xsd:complexType name="Device"> > > <xsd:sequence> > > <xsd:element minOccurs="1" maxOccurs="1" name="SKU" type="xsd:string"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="BECSRefId" > > type="xsd:int"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="SerialNumber" > > type="xsd:string"/> > > <xsd:element minOccurs="0" maxOccurs="1" name="ConsumerId" > > type="xsd:string"/> > > <xsd:element minOccurs="1" maxOccurs="1" name="DeviceStatus" > > type="tns:DeviceStatusValues"/> > > <xsd:element minOccurs="1" maxOccurs="1" > > name="DeviceStatusEffectiveDate" type="xsd:dateTime"/> > > </xsd:sequence> > > </xsd:complexType> > > <xsd:simpleType name="DeviceStatusValues"> > > <xsd:restriction base="xsd:string"> > > <xsd:enumeration value="Active" /> > > <xsd:enumeration value="Inactive" /> > > <xsd:enumeration value="RMA" /> > > </xsd:restriction> > > </xsd:simpleType> > > <xsd:element name="PutDeviceStatusResponse"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element minOccurs="0" maxOccurs="1" name="PutDeviceStatusResponse" > > type="xsd:string"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > </xsd:schema> > > </wsdl:types> > > <wsdl:message name="PutDeviceStatusRequest"> > > <wsdl:part element="tns:PutDeviceStatus" name="parameters" /> > > </wsdl:message> > > <wsdl:message name="PutDeviceStatusResponse"> > > <wsdl:part element="tns:PutDeviceStatusResponse" name="parameters" /> > > </wsdl:message> > > <wsdl:portType name="Service"> > > <wsdl:operation name="PutDeviceStatus"> > > <wsdl:input message="tns:PutDeviceStatusRequest" /> > > <wsdl:output message="tns:PutDeviceStatusResponse" /> > > </wsdl:operation> > > </wsdl:portType> > > <wsdl:binding name="ServiceSOAP" type="tns:Service"> > > <soap:binding style="document" > > transport="http://schemas.xmlsoap.org/soap/http" /> > > <wsdl:operation name="PutDeviceStatus"> > > <soap:operation soapAction="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service/PutDeviceStatus" /> > > <wsdl:input> > > <soap:body use="literal" /> > > </wsdl:input> > > <wsdl:output> > > <soap:body use="literal" /> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:binding> > > <wsdl:service name="Service"> > > <wsdl:port binding="tns:ServiceSOAP" name="ServiceSOAP"> > > <soap:address location="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/" /> > > </wsdl:port> > > </wsdl:service> > > </wsdl:definitions> > > ------------------------------------------------------------- > > This source wsdl file passed all compliance and validation tests. I > > packaged and deployed exploded the project on JBoss. I am still using > > XFire 1.2.4 which comes with MyEclipse5.5M2. I verified the deployed war > > and inside it the wsdl file is correct and identical with the project > > source wsdl file as it is in the above code description. > > > > > > Now I start the JBoss server, I can go and access the wsdl exact as > > described in the source wsdl file but the first "wsdl:definitions" tag > > is formatted wrong with LF line feed and carriage return when in the > > original wsdl file is simple all in one line! Also contains a > > "xmlns:ns1" which is not present in the original "wsdl:definitions" tag > > (in the source wsdl file). So here is the page source for the wsdl > > accessed at this url: "http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service?wsdl" (as you can observe > > I can access this URL wth no problem but the wsdl here is not at all in > > sync as it should be with the original wsdl from the deployed war): > > ------------------------------------------------------------- > > <?xml version="1.0" encoding="UTF-8"?> > > <wsdl:definitions targetNamespace=" > > > > http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service > > " xmlns:tns=" > > > > http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service > > " xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > > xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" > > xmlns:ns1="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" > > xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > > <wsdl:types> > > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > attributeFormDefault="qualified" elementFormDefault="qualified" > > targetNamespace=" > > 			http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service > > ; 		"> > > <xsd:element name="User" type="xsd:string"/> > > <xsd:element name="Password" type="xsd:string"/> > > <xsd:element name="DeviceStatusMessageDoc" > > type="ns1:DeviceStatusMessageDoc"/> > > <xsd:element name="PutDeviceStatusResponse" type="xsd:string"/> > > </xsd:schema> > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > targetNamespace="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service" > > version="1.0"> > > <xs:complexType name="DeviceStatusMessageDoc"> > > <xs:sequence> > > <xs:element name="CreationDate" type="xs:anySimpleType"/> > > <xs:element name="SequenceNumber" type="xs:string"/> > > <xs:element name="Version" type="xs:string"/> > > <xs:element > > xmlns:ns1="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service" > > name="Devices" type="ns1:ArrayOfDevices"/> > > </xs:sequence> > > </xs:complexType> > > <xs:complexType name="ArrayOfDevices"> > > <xs:sequence> > > <xs:element > > xmlns:ns2="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service" > > maxOccurs="unbounded" minOccurs="0" name="Device" nillable="true" > > type="ns2:Device"/> > > </xs:sequence> > > </xs:complexType> > > <xs:complexType name="Device"> > > <xs:sequence> > > <xs:element name="SKU" type="xs:string"/> > > <xs:element name="BECSRefId" type="xs:int"/> > > <xs:element name="SerialNumber" type="xs:string"/> > > <xs:element minOccurs="0" name="ConsumerId" type="xs:string"/> > > <xs:element > > xmlns:ns3="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service" > > name="DeviceStatus" type="ns3:deviceStatusValues"/> > > <xs:element name="DeviceStatusEffectiveDate" type="xs:anySimpleType"/> > > </xs:sequence> > > </xs:complexType> > > <xs:simpleType name="deviceStatusValues"> > > <xs:restriction base="xs:string"> > > <xs:enumeration value="RMA"/> > > <xs:enumeration value="Inactive"/> > > <xs:enumeration value="Active"/> > > </xs:restriction> > > </xs:simpleType> > > </xs:schema> > > </wsdl:types> > > <wsdl:message name="PutDeviceStatusRequest"> > > <wsdl:part name="User" element="tns:User"> > > </wsdl:part> > > <wsdl:part name="Password" element="tns:Password"> > > </wsdl:part> > > <wsdl:part name="DeviceStatusMessageDoc" > > element="tns:DeviceStatusMessageDoc"> > > </wsdl:part> > > </wsdl:message> > > <wsdl:message name="PutDeviceStatusResponse"> > > <wsdl:part name="PutDeviceStatusResponse" > > element="tns:PutDeviceStatusResponse"> > > </wsdl:part> > > </wsdl:message> > > <wsdl:portType name="Service"> > > <wsdl:operation name="PutDeviceStatus"> > > <wsdl:input name="PutDeviceStatusRequest" > > message="tns:PutDeviceStatusRequest"> > > </wsdl:input> > > <wsdl:output name="PutDeviceStatusResponse" > > message="tns:PutDeviceStatusResponse"> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:portType> > > <wsdl:binding name="ServiceHttpBinding" type="tns:Service"> > > <wsdlsoap:binding style="document" > > transport="http://schemas.xmlsoap.org/soap/http"/> > > <wsdl:operation name="PutDeviceStatus"> > > <wsdlsoap:operation > > soapAction="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service/PutDeviceStatus"/> > > <wsdl:input name="PutDeviceStatusRequest"> > > <wsdlsoap:body use="literal"/> > > </wsdl:input> > > <wsdl:output name="PutDeviceStatusResponse"> > > <wsdlsoap:body use="literal"/> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:binding> > > <wsdl:service name="Service"> > > <wsdl:port name="ServiceHttpPort" binding="tns:ServiceHttpBinding"> > > <wsdlsoap:address > > location="http://dddpavel-lnx.dynadocs.com:8080/localenergylixar/Service"/> > > </wsdl:port> > > </wsdl:service> > > </wsdl:definitions> > > ------------------------------------------------------------- > > As you can observe the "<wsdl:definitions" tag has a strange incorrect > > format that translates into a wrong "xsd:schema" tag later on: > > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > attributeFormDefault="qualified" elementFormDefault="qualified" > > targetNamespace=" 			http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service 		"> > > > > Can somebody help me understand why is the xmlns:ns1="http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service" present in the serviced > > "<wsdl:definitions" tag when in the original file I use only one tns > > everywhere (http://dddpavel- > > lnx.dynadocs.com:8080/localenergylixar/Service) including for all the > > "xsd:element" that needed a specific type declared ? And why is that > > format (with extra characters) of the "<wsdl:definitions" tag present in > > the serviced wsdl when the original is in only one line with no other > > characters in between ? This is a major stop for this deployment... > > > > > > Any suggestions will be greatly appreciated and really needed. > > > > > > ASIDE: the packaged war contains all the libraries for all components, > > including XFire in a big lib directory; if I need to create multiple > > war's for different clients (in order that some of the clients should > > NOT see the wsdl of another client, because if I put multiple wsdl in > > the same big war everybody can access the other wsdl present in that war > > right?) these packages are pretty big and contain the same jar file > > libraries. Is there a way to put the common jar's in a common lib and > > access those from there for all the war packages or something similar > > (deployment of war's but the reuse common libraries like the one for > > XFire for example?). If I have n clients and n war packages containing > > same libraries that's not good at all... > > > > > > > > On Fri, 2007-04-05 at 19:15 -0400, Dragos Pavel wrote: > > > When I run the test client in the present I get this error: > > > --------------------------------------------------------------------------------- > > > 4-May-2007 6:22:42 PM org.codehaus.xfire.transport.http.HttpChannel > > > sendViaClient > > > SEVERE: Server returned error code = 404 for URI : http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/. Check server logs for details > > > Exception from ServiceClient: Could not invoke service.. Nested > > > exception is org.codehaus.xfire.fault.XFireFault: Server returned error > > > code = 404 for URI : http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/. Check server logs for details > > > --------------------------------------------------------------------------------- > > > There are no details in the server logs because the invocation fails. > > > > > > > > > OK let me explain what is happening: > > > I created a correct wsdl file for my web service; checked it many many > > > times and is correct and passes the validation fine. I build the project > > > deploy it on JBoss and check the wsdl inside the deployed war which is > > > correct and in sync with the one in the project as it should be. > > > Now I start the JBoss AS and then run the test Client and I get the > > > error mentioned above. I have to mention that I am testing on my local > > > computer doing a loop; my loop environment includes a apache server with > > > mod_jk in it for outbound access; that's fine, I am able to go to > > > http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/ > > > or to http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service? > > > wsdl > > > and check/view the wsdl on the Firefox browser, but here when I access > > > the "View Page Source" for the related wsdl I have a BIG BIG NEGATIVE > > > SURPRISE = this wsdl served by my server is nothing like the original > > > wsdl configured and created by me in the project. How this is possible, > > > only deploying to JBoss that the wsdl abstract interface gets > > > interpreted and modified... ??? > > > > > > > > > This is the viewed page source from the browser: > > > ------------------------------------------------------------------------------------------------ > > > <?xml version="1.0" encoding="UTF-8"?> > > > <wsdl:definitions targetNamespace=" > > > > > > http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service > > > " xmlns:tns=" > > > > > > http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service > > > " xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > > > xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" > > > xmlns:ns1="http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" > > > xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" > > > xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" > > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> > > > <wsdl:types> > > > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > attributeFormDefault="qualified" elementFormDefault="qualified" > > > targetNamespace=" 			http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service > > > ;"> > > > <xsd:element name="User" type="xsd:string"/> > > > <xsd:element name="Password" type="xsd:string"/> > > > <xsd:element name="DeviceStatusMessageDoc" > > > type="ns1:DeviceStatusMessageDoc"/> > > > <xsd:element name="PutDeviceStatusResponse" type="xsd:string"/> > > > </xsd:schema> > > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > > targetNamespace="http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > version="1.0"> > > > <xs:complexType name="DeviceStatusMessageDoc"> > > > <xs:sequence> > > > <xs:element name="CreationDate" type="xs:anySimpleType"/> > > > <xs:element name="SequenceNumber" type="xs:string"/> > > > <xs:element name="Version" type="xs:string"/> > > > <xs:element > > > xmlns:ns1="http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > name="Devices" type="ns1:ArrayOfDevices"/> > > > </xs:sequence> > > > </xs:complexType> > > > <xs:complexType name="ArrayOfDevices"> > > > <xs:sequence> > > > <xs:element > > > xmlns:ns2="http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > maxOccurs="unbounded" minOccurs="0" name="Device" nillable="true" > > > type="ns2:Device"/> > > > </xs:sequence> > > > </xs:complexType> > > > <xs:complexType name="Device"> > > > <xs:sequence> > > > <xs:element name="SKU" type="xs:string"/> > > > <xs:element name="BECSRefId" type="xs:int"/> > > > <xs:element name="SerialNumber" type="xs:string"/> > > > <xs:element minOccurs="0" name="ConsumerId" type="xs:string"/> > > > <xs:element > > > xmlns:ns3="http://dddpavel-lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > name="DeviceStatus" type="ns3:deviceStatusValues"/> > > > <xs:element name="DeviceStatusEffectiveDate" type="xs:anySimpleType"/> > > > </xs:sequence> > > > </xs:complexType> > > > <xs:simpleType name="deviceStatusValues"> > > > <xs:restriction base="xs:string"> > > > <xs:enumeration value="RMA"/> > > > <xs:enumeration value="Inactive"/> > > > <xs:enumeration value="Active"/> > > > </xs:restriction> > > > </xs:simpleType> > > > </xs:schema> > > > </wsdl:types> > > > from here on everything is OK in the wsdl ... > > > ------------------------------------------------------------------------------------------------ > > > > > > > > > But here is what I configured in the wsdl that I created: > > > ------------------------------------------------------------------------------------------------ > > > <?xml version="1.0" encoding="UTF-8"?> > > > <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > > > xmlns:tns="http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/Service" > > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Service" > > > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" > > > targetNamespace="http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/Service"> > > > > > > <wsdl:types> > > > <xsd:schema targetNamespace="http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/Service"> > > > > > > <xsd:element name="PutDeviceStatus"> > > > <xsd:complexType> > > > <xsd:sequence> > > > <xsd:element minOccurs="0" maxOccurs="1" name="User" type="xsd:string"/> > > > <xsd:element minOccurs="0" maxOccurs="1" name="Password" > > > type="xsd:string"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="DeviceStatusMessageDoc" > > > nillable="true" type="tns:DeviceStatusMessageDoc"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > </xsd:element> > > > > > > <xsd:complexType name="DeviceStatusMessageDoc"> > > > <xsd:sequence> > > > <xsd:element minOccurs="1" maxOccurs="1" name="CreationDate" > > > type="xsd:dateTime"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="SequenceNumber" > > > type="xsd:string"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="Version" > > > type="xsd:string"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="Devices" > > > type="tns:ArrayOfDevices"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > > > > <xsd:complexType name="ArrayOfDevices"> > > > <xsd:sequence> > > > <xsd:element minOccurs="0" maxOccurs="unbounded" name="Device" > > > nillable="true" type="tns:Device"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > > > > <xsd:complexType name="Device"> > > > <xsd:sequence> > > > <xsd:element minOccurs="1" maxOccurs="1" name="SKU" type="xsd:string"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="BECSRefId" > > > type="xsd:int"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="SerialNumber" > > > type="xsd:string"/> > > > <xsd:element minOccurs="0" maxOccurs="1" name="ConsumerId" > > > type="xsd:string"/> > > > <xsd:element minOccurs="1" maxOccurs="1" name="DeviceStatus" > > > type="tns:DeviceStatusValues"/> > > > <xsd:element minOccurs="1" maxOccurs="1" > > > name="DeviceStatusEffectiveDate" type="xsd:dateTime"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > > > > <xsd:simpleType name="DeviceStatusValues"> > > > <xsd:restriction base="xsd:string"> > > > <xsd:enumeration value="Active" /> > > > <xsd:enumeration value="Inactive" /> > > > <xsd:enumeration value="RMA" /> > > > </xsd:restriction> > > > </xsd:simpleType> > > > > > > <xsd:element name="PutDeviceStatusResponse"> > > > <xsd:complexType> > > > <xsd:sequence> > > > <xsd:element minOccurs="0" maxOccurs="1" name="PutDeviceStatusResponse" > > > type="xsd:string"/> > > > </xsd:sequence> > > > </xsd:complexType> > > > </xsd:element> > > > > > > </xsd:schema> > > > </wsdl:types> > > > > > > <wsdl:message name="PutDeviceStatusRequest"> > > > <wsdl:part element="tns:PutDeviceStatus" name="parameters" /> > > > </wsdl:message> > > > <wsdl:message name="PutDeviceStatusResponse"> > > > <wsdl:part element="tns:PutDeviceStatusResponse" name="parameters" /> > > > </wsdl:message> > > > > > > <wsdl:portType name="Service"> > > > <wsdl:operation name="PutDeviceStatus"> > > > <wsdl:input message="tns:PutDeviceStatusRequest" /> > > > <wsdl:output message="tns:PutDeviceStatusResponse" /> > > > </wsdl:operation> > > > </wsdl:portType> > > > > > > <wsdl:binding name="ServiceSOAP" type="tns:Service"> > > > <soap:binding style="document" > > > transport="http://schemas.xmlsoap.org/soap/http" /> > > > <wsdl:operation name="PutDeviceStatus"> > > > <soap:operation soapAction="http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/Service/PutDeviceStatus" /> > > > <wsdl:input> > > > <soap:body use="literal" /> > > > </wsdl:input> > > > <wsdl:output> > > > <soap:body use="literal" /> > > > </wsdl:output> > > > </wsdl:operation> > > > </wsdl:binding> > > > > > > <wsdl:service name="Service"> > > > <wsdl:port binding="tns:ServiceSOAP" name="ServiceSOAP"> > > > <soap:address location="http://dddpavel- > > > lnx.dynadocs.com:8080/dragosenergylixar/" /> > > > </wsdl:port> > > > </wsdl:service> > > > </wsdl:definitions> > > > ------------------------------------------------------------------------------------------------ > > > > > > Can someone explain to me the differences and especial why is there ns1, > > > ns2 and ns3 instead to be only one target namespace which is defined in > > > my wsdl that I wrote (see my wsdl right above) ? And why is there 'xs:' > > > instead to be 'xsd:" as I used everywhere in my wsdl ... And the strange > > > characters at the end of the targetNamespace in the > > > wsdl:definitions ... ??? > > > > > > The error above (404) means that the server has not found anything > > > matching the Request-URI, however I am able to access on the browser the > > > exact URL that XFire is complaining and throwing that severe > > > error... ??? > > > > > > Need to know how can I resolve this problem. > > > > > > Thanks in advance. > > > > > > > > > On Fri, 2007-04-05 at 12:50 -0400, Dragos Pavel wrote: > > > > Hi and Thank You Tomek. > > > > > > > > Here is the SOAP message intercepted: > > > > ------------------------------------------------------------------------------------- > > > > POST /energylixar/ HTTP/1.1 > > > > SOAPAction: "http://localhost:8080/energylixar/Service/PutDeviceStatus" > > > > Content-Type: text/xml; charset=UTF-8 > > > > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire > > > > Client +http://xfire.codehaus.org) > > > > Host: 127.0.0.1:9080 > > > > Expect: 100-continue > > > > Content-Length: 2930 > > > > > > > > > > > > <soap:Envelope 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:Body> > > > > <PutDeviceStatus > > > > xmlns="http://localhost:8080/energylixar/Service"> > > > > <User > > > > xmlns="http://localhost:8080/energylixar/Service">...</User> > > > > <Password > > > > xmlns="http://localhost:8080/energylixar/Service">...</Password> > > > > <ns2:DeviceStatusMessageDoc xmlns="" > > > > xmlns:ns2="http://localhost:8080/energylixar/Service"> > > > > <CreationDate>2007-03-31T15:03:59</CreationDate> > > > > <SequenceNumber>2</SequenceNumber> > > > > <Version>test</Version> > > > > <Devices> > > > > <Device> > > > > <SKU>BECHG</SKU> > > > > <BECSRefId>2557</BECSRefId> > > > > <SerialNumber>112353325633465</SerialNumber> > > > > <ConsumerId>3455543</ConsumerId> > > > > <DeviceStatus>Active</DeviceStatus> > > > > > > > > <DeviceStatusEffectiveDate>2007-04-02T15:03:59</DeviceStatusEffectiveDate> > > > > </Device> > > > > ...all this is correct... > > > > <Device> > > > > <SKU>BECHVC</SKU> > > > > <BECSRefId>2565</BECSRefId> > > > > <SerialNumber>A-95753256</SerialNumber> > > > > <ConsumerId>3562</ConsumerId> > > > > <DeviceStatus>Inactive</DeviceStatus> > > > > > > > > <DeviceStatusEffectiveDate>2007-04-03T17:55:55</DeviceStatusEffectiveDate> > > > > </Device> > > > > </Devices> > > > > </ns2:DeviceStatusMessageDoc> > > > > </PutDeviceStatus> > > > > </soap:Body></soap:Envelope> > > > > ------------------------------------------------------------------------------------- > > > > > > > > What I find strange is this tag: > > > > <ns2:DeviceStatusMessageDoc xmlns="" > > > > xmlns:ns2="http://localhost:8080/energylixar/Service"> > > > > I don't have any reference to this ns2 in my wsdl file and though is > > > > being created, can you help me understand why ? Anyway I think is wrong > > > > with xmlns="" empty... > > > > Beside this I don't know what else is wrong in my DOCTYPE declaration. > > > > > > > > Many Thanks. > > > > > > > > > > > > > > > > On Fri, 2007-04-05 at 17:49 +0200, Tomek Sztelak wrote: > > > > > Hi > > > > > Try to use TCPMON to intercept soap message and see how DOCTYPE > > > > > declaration looks like. > > > > > > > > > > You can find description how to upgrade XFire jars here : > > > > > http://www.myeclipseide.com/PNphpBB2-viewtopic-t-15926-sid-32abfe283bfd00f8160332ebe265c301.html > > > > > > > > > > On 5/4/07, Dragos Pavel <[EMAIL PROTECTED]> wrote: > > > > > > Hi All, > > > > > > > > > > > > I'm attempting to implement top-down web services using > > > > > > MyEclipse5.5M2 > > > > > > (with XFire 1.2.4) with XFire JAXB2 xml binding, deploying on a > > > > > > JBoss AS > > > > > > running on Linux. My wsdl interface that I created passed the > > > > > > validation > > > > > > fine. I developed the service implementation class for my web > > > > > > service > > > > > > interface, created and coded the test client but when I try to > > > > > > execte > > > > > > this client to verify my web service I get this exception: > > > > > > > > > > > > > > > > > > Exception from ServiceClient: Could not invoke service.. Nested > > > > > > exception is org.codehaus.xfire.fault.XFireFault: Unexpected > > > > > > character > > > > > > '"' (code 34) in DOCTYPE declaration; expected a space between > > > > > > public > > > > > > and system identifiers > > > > > > at [row,col {unknown-source}]: [4,63] > > > > > > > > > > > > > > > > > > Any idea about this issue? > > > > > > > > > > > > I found this thread on the myeclipse forum: > > > > > > > > > > > > http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-14600.html > > > > > > > > > > > > but funny enough the replies were on other topics not on the > > > > > > subject the > > > > > > first person posted and initiated the thread. > > > > > > > > > > > > Please help me with this if you can, > > > > > > Thanks in advance, > > > > > > Dragos > > > > > > > > > > > > PS: if anybody has knowledge about how to upgrade XFire in > > > > > > MyEclipse to > > > > > > be able to use the latest 1.2.6 release please let us know; the > > > > > > problem > > > > > > is that MyEclipse is organizing the XFire libraries in a different > > > > > > way, > > > > > > more precise: the MyEclipse organization done for the XFire and > > > > > > other > > > > > > large-frameworks like Spring, is to partition them off to help make > > > > > > managing them a little bit easier. It was suggested this: > > > > > > "What you *could* do is just remove all the MyEclipse XFire > > > > > > libraries > > > > > > from your build path, and go drop the 1.2.5-all JAR into your WEB- > > > > > > INF/lib directory instead." > > > > > > Well I tried that (droped the 1.2.5 jar into the lib directory and > > > > > > removed the original XFire libraries from the path) but it doesn't > > > > > > work... > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > To unsubscribe from this list please visit: > > > > > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe from this list please visit: > > > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe from this list please visit: > > > > > > http://xircles.codehaus.org/manage_email > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email > > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
