[
https://issues.apache.org/jira/browse/AXIS2-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539023
]
Adrian Lang commented on AXIS2-3293:
------------------------------------
I got the same problem:
----
import org.apache.axis2.Constants;
import org.apache.axis2.description.TransportOutDescription;
import org.apache.log4j.Appender;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import pcograb.service_wsdl.ServiceStub;
import pcograb.service_wsdl.ServiceStub.GetImage;
import pcograb.service_wsdl.ServiceStub.GetImageResponse;
public class pcoGrabClient {
public static void main(String[] args) throws Exception {
Appender newAppender = new ConsoleAppender(new PatternLayout("%r [%t]
%-5p %c - %m%n"));
Logger.getRootLogger().addAppender(newAppender);
ServiceStub stub = new ServiceStub("tcp://pcograbber:5000");
stub._getServiceClient().getOptions().setTransportOut(new
TransportOutDescription(Constants.TRANSPORT_TCP));
//Create the request
GetImage request = new GetImage();
//Invoke the service
GetImageResponse response = stub.getImage(request);
}
}
----
----
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Service"
targetNamespace="http://localhost:80/Service.wsdl"
xmlns:tns="http://localhost:80/Service.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:pcoGrab="http://tempuri.org/pcoGrab.xsd"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://tempuri.org/pcoGrab.xsd"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:pcoGrab="http://tempuri.org/pcoGrab.xsd"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<!-- operation request element -->
<element name="getImage">
<complexType>
<sequence>
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getImageResponse">
<complexType>
<sequence>
<element name="result" type="xsd:int" minOccurs="0" maxOccurs="1"
nillable="true"/>
</sequence>
</complexType>
</element>
<!-- operation request element -->
<element name="setROI">
<complexType>
<sequence>
<element name="width" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<element name="height" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<element name="offset-x" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<element name="offset-y" type="xsd:int" minOccurs="1" maxOccurs="1"/>
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="setROIResponse">
<complexType>
<sequence>
<element name="result" type="xsd:int" minOccurs="0" maxOccurs="1"
nillable="true"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="getImageRequest">
<part name="parameters" element="pcoGrab:getImage"/>
</message>
<message name="getImageResponse">
<part name="parameters" element="pcoGrab:getImageResponse"/>
</message>
<message name="setROIRequest">
<part name="parameters" element="pcoGrab:setROI"/>
</message>
<message name="setROIResponse">
<part name="parameters" element="pcoGrab:setROIResponse"/>
</message>
<portType name="ServicePortType">
<operation name="getImage">
<documentation>Service definition of function
pcoGrab__getImage</documentation>
<input message="tns:getImageRequest"/>
<output message="tns:getImageResponse"/>
</operation>
<operation name="setROI">
<documentation>Service definition of function pcoGrab__setROI</documentation>
<input message="tns:setROIRequest"/>
<output message="tns:setROIResponse"/>
</operation>
</portType>
<binding name="Service" type="tns:ServicePortType">
<SOAP:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getImage">
<SOAP:operation soapAction=""/>
<input>
<SOAP:body parts="parameters" use="literal"/>
</input>
<output>
<SOAP:body parts="parameters" use="literal"/>
</output>
</operation>
<operation name="setROI">
<SOAP:operation soapAction=""/>
<input>
<SOAP:body parts="parameters" use="literal"/>
</input>
<output>
<SOAP:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="Service">
<documentation>gSOAP 2.7.9d generated service definition</documentation>
<port name="Service" binding="tns:Service">
<SOAP:address location="http://localhost:80"/>
</port>
</service>
</definitions>
----
> NPE in AxisEngine when trying to use TCP transport
> --------------------------------------------------
>
> Key: AXIS2-3293
> URL: https://issues.apache.org/jira/browse/AXIS2-3293
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: client-api
> Affects Versions: 1.3
> Reporter: dror yaffe
>
> Here is the excpetion:
> java.lang.NullPointerException
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> at
> org.tempuri.KongServerHttpEndpointStub.Send(KongServerHttpEndpointStub.java:184)
> at org.tempuri.Main.doWork(Main.java:45)
> at org.tempuri.Main.main(Main.java:57)
> client code:
> public void doWork() throws Exception{
> String
> TARGET_END_POINT="tcp://127.0.0.1:8080/KongServerWebApplication/KongServerHttpEndpoint.asmx";
>
> KongServerHttpEndpointStub stub = new
> KongServerHttpEndpointStub(TARGET_END_POINT);
> EndpointReference target = new EndpointReference(TARGET_END_POINT);
> Options options = new Options();
> options.setTo(target);
> options.setSenderTransport(Constants.TRANSPORT_TCP, cfg);
> options.setTransportInProtocol(Constants.TRANSPORT_TCP);
> TransportOutDescription x = new
> TransportOutDescription(Constants.TRANSPORT_TCP);
> options.setTransportOut(x);
> stub._getServiceClient().setOptions(options);
>
>
> Send send = new Send();
> KongMessage msg= new KongMessage();
> send.setMessage(msg);
> SendResponse res = stub.Send(send);
> System.out.println("got res = "+res.getSendResult());
>
> }
> I used AXIS2 eclipse plugin code generator, here is the
> KongServerHttpEndpoint.wsdl
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://tempuri.org/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
> xmlns:s="http://www.w3.org/2001/XMLSchema"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://tempuri.org/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
> <wsdl:types>
> <s:schema elementFormDefault="qualified"
> targetNamespace="http://tempuri.org/">
> <s:element name="Send">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="message"
> type="tns:KongMessage"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:complexType name="KongMessage">
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="0" name="OnBehalfOf"
> type="s:string"/>
> </s:sequence>
> </s:complexType>
> <s:element name="SendResponse">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="1" name="SendResult"
> type="s:boolean"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="Write">
> <s:complexType/>
> </s:element>
> <s:element name="WriteResponse">
> <s:complexType>
> <s:sequence>
> <s:element maxOccurs="1" minOccurs="1" name="WriteResult"
> type="s:boolean"/>
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> </wsdl:types>
> <wsdl:message name="WriteSoapOut">
> <wsdl:part name="parameters" element="tns:WriteResponse">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="WriteSoapIn">
> <wsdl:part name="parameters" element="tns:Write">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="SendSoapIn">
> <wsdl:part name="parameters" element="tns:Send">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="SendSoapOut">
> <wsdl:part name="parameters" element="tns:SendResponse">
> </wsdl:part>
> </wsdl:message>
> <wsdl:portType name="KongServerHttpEndpointSoap">
> <wsdl:operation name="Send">
> <wsdl:input message="tns:SendSoapIn">
> </wsdl:input>
> <wsdl:output message="tns:SendSoapOut">
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="Write">
> <wsdl:input message="tns:WriteSoapIn">
> </wsdl:input>
> <wsdl:output message="tns:WriteSoapOut">
> </wsdl:output>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="KongServerHttpEndpointSoap"
> type="tns:KongServerHttpEndpointSoap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="Send">
> <soap:operation soapAction="http://tempuri.org/Send" style="document"/>
> <wsdl:input>
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="Write">
> <soap:operation soapAction="http://tempuri.org/Write" style="document"/>
> <wsdl:input>
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:binding name="KongServerHttpEndpointSoap12"
> type="tns:KongServerHttpEndpointSoap">
> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="Send">
> <soap12:operation soapAction="http://tempuri.org/Send"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="Write">
> <soap12:operation soapAction="http://tempuri.org/Write"
> style="document"/>
> <wsdl:input>
> <soap12:body use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="KongServerHttpEndpoint">
> <wsdl:port name="KongServerHttpEndpointSoap12"
> binding="tns:KongServerHttpEndpointSoap12">
> <soap12:address
> location="http://localhost/KongServerWebApplication/KongServerHttpEndpoint.asmx"/>
> </wsdl:port>
> <wsdl:port name="KongServerHttpEndpointSoap"
> binding="tns:KongServerHttpEndpointSoap">
> <soap:address
> location="http://localhost/KongServerWebApplication/KongServerHttpEndpoint.asmx"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]