9 Replies Latest reply on May 24, 2006 6:16 AM by grahambrown11

    Examples

    grahambrown11

      The Wiki/Documentation is not updated with JBossWS it is all still JBossWS4EE
      when will that be updated?

        • 1. Re: Examples
          thomas.diesler

          What page are you refering to? The old wiki content is preserved for backward compatibility.

          • 2. Re: Examples
            grahambrown11

            The "JBoss Admin & Developers Guide" chapter 12
            Is there any documentation on how to use WSTools?
            I wish to create classes from a WSDL (i.e. WSDLToJava)
            I had an issue in the old axis impl, I got a NullPointerException when the namespace in the "types" was "urn:sap-com:document:sap:rfc:functions"
            so I am trying this new ws impl

            • 3. Re: Examples
              thomas.diesler

              If this is jbossws-1.0.0.GA, I'd like to see the stacktrace

              • 4. Re: Examples
                grahambrown11

                Here is the stacktrace you asked for


                javax.xml.rpc.ServiceException: java.lang.NullPointerException
                at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:135)
                at coza.healthbridge.netcare.client.TestClient.netcareSimpleTest(TestClient.java:127)
                at coza.healthbridge.netcare.client.TestClient.main(TestClient.java:282)

                Caused by: java.lang.NullPointerException
                at java.util.StringTokenizer.<init>(Unknown Source)
                at java.util.StringTokenizer.<init>(Unknown Source)
                at org.jboss.webservice.deployment.ServiceDescription.getPackageName(ServiceDescription.java:947)
                at org.jboss.webservice.deployment.ServiceDescription.initTypeMappings(ServiceDescription.java:894)
                at org.jboss.webservice.deployment.ServiceDescription.initServiceDescription(ServiceDescription.java:141)
                at org.jboss.webservice.deployment.ServiceDescription.<init>(ServiceDescription.java:108)
                at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:130)
                ... 2 more

                here is the WSDL

                <?xml version="1.0" encoding="UTF-8"?>
                <wsdl:definitions name="SynchronousSoapReceiver" targetNamespace="http://netcare.co.za/xi/switchtonetcare" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:p1="http://netcare.co.za/xi/switchtonetcare" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                <wsdl:types>
                <xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                <xsd:element name="Z_SOAP_ECHOSERVICE.Response">
                <xsd:complexType>
                <xsd:all>
                <xsd:element name="DATAOUT" minOccurs="0">
                <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                <xsd:maxLength value="32000"/>
                </xsd:restriction>
                </xsd:simpleType>
                </xsd:element>
                </xsd:all>
                </xsd:complexType>
                </xsd:element>
                <xsd:element name="Z_SOAP_ECHOSERVICE">
                <xsd:complexType>
                <xsd:all>
                <xsd:element name="DATAIN">
                <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                <xsd:maxLength value="32000"/>
                </xsd:restriction>
                </xsd:simpleType>
                </xsd:element>
                </xsd:all>
                </xsd:complexType>
                </xsd:element>
                </xsd:schema>
                </wsdl:types>
                <wsdl:message name="rfc.Z_SOAP_ECHOSERVICE.Input">
                <wsdl:part name="parameters" element="rfc:Z_SOAP_ECHOSERVICE" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
                </wsdl:message>
                <wsdl:message name="rfc.Z_SOAP_ECHOSERVICE.Output">
                <wsdl:part name="parameters" element="rfc:Z_SOAP_ECHOSERVICE.Response" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
                </wsdl:message>
                <wsdl:portType name="SynchronousSoapReceiver">
                <wsdl:operation name="SynchronousSoapReceiver">
                <wsdl:input message="p1:rfc.Z_SOAP_ECHOSERVICE.Input"/>
                <wsdl:output message="p1:rfc.Z_SOAP_ECHOSERVICE.Output"/>
                </wsdl:operation>
                </wsdl:portType>
                <wsdl:binding name="SynchronousSoapReceiverBinding" type="p1:SynchronousSoapReceiver" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
                <wsdl:operation name="SynchronousSoapReceiver">
                <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
                <wsdl:input>
                <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
                </wsdl:input>
                <wsdl:output>
                <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
                </wsdl:output>
                </wsdl:operation>
                </wsdl:binding>
                <wsdl:service name="SynchronousSoapReceiverService">
                <wsdl:port name="SynchronousSoapReceiverPort" binding="p1:SynchronousSoapReceiverBinding" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                <soap:address
                location="http://ntcdxi01:50100/XISOAPAdapter/MessageServlet?channel=:DXI_Client_400:SynchronousWebService&version=3.0&Sender.Service=DXI_Client_400&Interface=http%3A%2F%2Fnetcare.co.za%2Fxi%2Fswitchtonetcare%5ESynchronousSoapReceiver"
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
                </wsdl:port>
                </wsdl:service>
                </wsdl:definitions>

                here is my code
                QName service = new QName("http://netcare.co.za/xi/switchtonetcare", "SynchronousSoapReceiverService");
                QName port = new QName("http://netcare.co.za/xi/switchtonetcare", "SynchronousSoapReceiverPort");
                QName operation = new QName("SynchronousSoapReceiver");
                QName arg = new QName("urn:sap-com:document:sap:rfc:functions");
                URL wsdlUrl = new URL("file:///D:/SynchronousSoapReceiver.wsdl");
                ServiceFactory factory = ServiceFactory.newInstance();
                Service service = factory.createService(wsdlUrl, service);
                Call call = service.createCall(port, operation);
                Object oRet = call.invoke(new Object[] { getDoc().getDocumentElement() });
                


                • 5. Re: Examples
                  grahambrown11

                  the code shlould be

                  QName serviceQN = new QName("http://netcare.co.za/xi/switchtonetcare", "SynchronousSoapReceiverService");
                  QName port = new QName("http://netcare.co.za/xi/switchtonetcare", "SynchronousSoapReceiverPort");
                  QName operation = new QName("SynchronousSoapReceiver");
                  QName arg = new QName("urn:sap-com:document:sap:rfc:functions");
                  URL wsdlUrl = new URL("file:///D:/SynchronousSoapReceiver.wsdl");
                  ServiceFactory factory = ServiceFactory.newInstance();
                  Service service = factory.createService(wsdlUrl, serviceQN);
                  Call call = service.createCall(port, operation);
                  Object oRet = call.invoke(new Object[] { getDoc().getDocumentElement() });
                  

                  The last one had 2 varables with the same name "service"

                  • 6. Re: Examples
                    thomas.diesler

                    From the stacktrace it does not seem to be jbossws-1.0.0.GA. jbossws uses org.jboss.ws not org.jboss.webservice.

                    • 7. Re: Examples
                      grahambrown11

                      Sorry I thought I had updated my classpath.

                      I now get a new error stacktrace bellow:


                      2006-05-16 09:56:06,314 [main] DEBUG org.jboss.ws.soap.MessageContextAssociation
                      (52) - popMessageContext: org.jboss.ws.soap.SOAPMessageContextImpl@14c194d
                      java.rmi.RemoteException: Call invocation failed: String index out of range: -54
                      ; nested exception is:
                      java.lang.StringIndexOutOfBoundsException: String index out of range: -5
                      4
                      at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:727)
                      at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:405)
                      at coza.healthbridge.netcare.client.TestClient.netcareSimpleTest(TestCli
                      ent.java:137)
                      at coza.healthbridge.netcare.client.TestClient.main(TestClient.java:282)

                      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
                      -54
                      at java.lang.String.substring(Unknown Source)
                      at org.jboss.remoting.InvokerLocator.<init>(InvokerLocator.java:155)
                      at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:119
                      )
                      at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:697)
                      ... 3 more

                      Seems to not like the location URL. If I use a SOAPConnection I get the same error, When I roll back to the JBoss-4.0.3 classpath it works...

                      • 8. Re: Examples
                        thomas.diesler

                        Is this the location URL?

                        http://ntcdxi01:50100/XISOAPAdapter/MessageServlet?channel=:DXI_Client_400:SynchronousWebService&version=3.0&Sender.Service=DXI_Client_400&Interface=http%3A%2F%2Fnetcare.co.za%2Fxi%2Fswitchtonetcare%5ESynchronousSoapReceiver
                        


                        • 9. Re: Examples
                          grahambrown11

                          Yip, I found a work around. I had to modify the WSDL and change the URL
                          The ':' characters were the problem, I encoded them (%3A)
                          URL is now

                          http://ntcdxi01:50100/XISOAPAdapter/MessageServlet?channel=%3ADXI_Client_400%3ASynchronousWebService&version=3.0&Sender.Service=DXI_Client_400&Interface=http%3A%2F%2Fnetcare.co.za%2Fxi%2Fswitchtonetcare%5ESynchronousSoapReceiver