DevT
DevT

Reputation: 4933

Service Mediation Using Proxy Services -WSO2

I'm new to this area and i need to access my web service via the ESB. as it mentioned in here - Service Mediation Using Proxy Services i tried to to create it. after that i run it and get the response as follows :

<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy"
h:status="SOAP envelope error">org.apache.axis2.AxisFault:
The input stream for an incoming message is null.</TryitProxyError>

but i tried to run same web method using SOAPUi and get the expected out put as below:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <getPatientHistoryResponse xmlns="http://tilani.lk/">
         <getPatientHistoryResult>
            <NIC>123</NIC>
            <FullName>ABC DEF</FullName>
            <FirstName>ABC</FirstName>
            <Surname>DEF</Surname>
            <Title>Mr.</Title>
            <Gender>M/Gender>
         </getPatientHistoryResult>
      </getPatientHistoryResponse>
   </soap:Body>
</soap:Envelope>

what is the reason for this? i created this using .net

my WSDL Address - http://localhost:2935/PatientRegService.asmx?WSDL

then in Define Endpoint as - http://localhost:2935/PatientRegService.asmx

EDIT my proxy configuration is as follows:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="PatientManagement" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <outSequence>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="http://localhost:2935/PatientRegService.asmx?WSDL"/>
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost:2935/PatientRegService.asmx?WSDL"/>
   <description></description>
</proxy>

Upvotes: 2

Views: 4842

Answers (2)

Ratha
Ratha

Reputation: 9692

Try the following proxy and see waht you are getting. Add this proxy configuration via source view editor.

 <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="testProxy"
           transports="https http"
           startOnLoad="true"
           trace="disable">
       <description/>
       <target>
          <inSequence>

             <log level="full">
                <property name="testprop" value="incoming message"/>

             </log>

             <send>
                <endpoint>
                   <address uri="http://localhost:2935/PatientRegService.asmx"/>
                </endpoint>
             </send>
          </inSequence>
          <outSequence>
             <send/>
          </outSequence>
       </target>
    </proxy>

Upvotes: 1

Maninda
Maninda

Reputation: 2216

If you just want to access your web service via ESB you need to create a proxy service and access the proxy service URI instead of the original service URI. Just follow the Pass Through Proxy example.

Upvotes: 3

Related Questions