SOAP Service through InvokeHTTP

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

SOAP Service through InvokeHTTP

mliem90
This post was updated on .
Hello,

I am looking to do a SOAP Web service call and was told invokeHTTP may be able to work. Wonder how I would be able to do this. For example, using curl I could invoke SOAP like the below:

curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: "http://www.webserviceX.NET/GetCitiesByCountry"" --data-binary @request.xml http://www.webservicex.net/globalweather.asmx

the request.xml:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://www.webserviceX.NET">
   <soap:Header/>
   <soap:Body>
      <web:GetCitiesByCountry>
         
         <web:CountryName>CANADA</web:CountryName>
      </web:GetCitiesByCountry>
   </soap:Body>
</soap:Envelope>

Looking to understand how I'd be able to pass the request.xml in the invokeHTTP

I know a custom built processor is an option, but looking to use what's available in the current version. Any other recommendations aside from invokeHTTP?
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Jeff
Hello,

With InvokeHTTP, you can add dynamic properties, which will be sent in the
request as headers.  You can use dynamic properties to set values for the
Content-Type and SOAPAction headers, just use the header names for the
names of the dynamic properties.  InvokeHTTP lets you control the HTTP
method, so you can set that to POST.  The remaining step would be to get
the content of request.xml to be sent to the InvokeHTTP as a flowfile.  One
way to do this is to use a GetFile processor to fetch requeset.xml from
some location on the filesystem, and pass the success relationship of
GetFile to InvokeHTTP.

On Wed, Aug 24, 2016 at 7:06 PM mliem90 <[hidden email]> wrote:

> Hello,
>
> I am looking to do a SOAP Web service call and was told invokeHTTP may be
> able to work. Wonder how I would be able to do this. For example, using
> curl
> I could invoke SOAP like the below:
>
> curl -X POST -H "Content-Type: text/xml" -H "SOAPAction:
> "http://www.webserviceX.NET/GetCitiesByCountry"" --data-binary
> @request.xml
> http://www.webservicex.net/globalweather.asmx
>
> the request.xml:
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> xmlns:web="http://www.webserviceX.NET">
>    <soap:Header/>
>    <soap:Body>
>       <web:GetCitiesByCountry>
>
>          <web:CountryName>CANADA</web:CountryName>
>       </web:GetCitiesByCountry>
>    </soap:Body>
> </soap:Envelope>
>
> I Appreciate the help!
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/SOAP-Service-through-InvokeHTTP-tp13129.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

mliem90
Awesome - did not know the contents of the flowfile would be passed as the result.xml.

worked perfectly.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Andrew Psaltis
In reply to this post by Jeff
Hello,
I have written a SOAP processor [1] that you are free to use. It has gotten
a bit of testing under it's belt, however, it can always use more. I am
totally open to fixing issues you may find and/or accepting PR's. If it
makes enough sense and is complete enough I have no problem contributing
it.

Thanks,
Andrew

[1] https://github.com/apsaltis/nifi-soap

On Wed, Aug 24, 2016 at 7:40 PM, Jeff <[hidden email]> wrote:

> Hello,
>
> With InvokeHTTP, you can add dynamic properties, which will be sent in the
> request as headers.  You can use dynamic properties to set values for the
> Content-Type and SOAPAction headers, just use the header names for the
> names of the dynamic properties.  InvokeHTTP lets you control the HTTP
> method, so you can set that to POST.  The remaining step would be to get
> the content of request.xml to be sent to the InvokeHTTP as a flowfile.  One
> way to do this is to use a GetFile processor to fetch requeset.xml from
> some location on the filesystem, and pass the success relationship of
> GetFile to InvokeHTTP.
>
> On Wed, Aug 24, 2016 at 7:06 PM mliem90 <[hidden email]> wrote:
>
> > Hello,
> >
> > I am looking to do a SOAP Web service call and was told invokeHTTP may be
> > able to work. Wonder how I would be able to do this. For example, using
> > curl
> > I could invoke SOAP like the below:
> >
> > curl -X POST -H "Content-Type: text/xml" -H "SOAPAction:
> > "http://www.webserviceX.NET/GetCitiesByCountry"" --data-binary
> > @request.xml
> > http://www.webservicex.net/globalweather.asmx
> >
> > the request.xml:
> > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> > xmlns:web="http://www.webserviceX.NET">
> >    <soap:Header/>
> >    <soap:Body>
> >       <web:GetCitiesByCountry>
> >
> >          <web:CountryName>CANADA</web:CountryName>
> >       </web:GetCitiesByCountry>
> >    </soap:Body>
> > </soap:Envelope>
> >
> > I Appreciate the help!
> >
> >
> >
> > --
> > View this message in context:
> > http://apache-nifi-developer-list.39713.n7.nabble.com/SOAP-
> Service-through-InvokeHTTP-tp13129.html
> > Sent from the Apache NiFi Developer List mailing list archive at
> > Nabble.com.
> >
>



--
Thanks,
Andrew

Subscribe to my book: Streaming Data <http://manning.com/psaltis>
<https://www.linkedin.com/pub/andrew-psaltis/1/17b/306>
twiiter: @itmdata <http://twitter.com/intent/user?screen_name=itmdata>
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Jeff
Glad it worked for you!

On Wed, Aug 24, 2016 at 8:10 PM Andrew Psaltis <[hidden email]>
wrote:

> Hello,
> I have written a SOAP processor [1] that you are free to use. It has gotten
> a bit of testing under it's belt, however, it can always use more. I am
> totally open to fixing issues you may find and/or accepting PR's. If it
> makes enough sense and is complete enough I have no problem contributing
> it.
>
> Thanks,
> Andrew
>
> [1] https://github.com/apsaltis/nifi-soap
>
> On Wed, Aug 24, 2016 at 7:40 PM, Jeff <[hidden email]> wrote:
>
> > Hello,
> >
> > With InvokeHTTP, you can add dynamic properties, which will be sent in
> the
> > request as headers.  You can use dynamic properties to set values for the
> > Content-Type and SOAPAction headers, just use the header names for the
> > names of the dynamic properties.  InvokeHTTP lets you control the HTTP
> > method, so you can set that to POST.  The remaining step would be to get
> > the content of request.xml to be sent to the InvokeHTTP as a flowfile.
> One
> > way to do this is to use a GetFile processor to fetch requeset.xml from
> > some location on the filesystem, and pass the success relationship of
> > GetFile to InvokeHTTP.
> >
> > On Wed, Aug 24, 2016 at 7:06 PM mliem90 <[hidden email]> wrote:
> >
> > > Hello,
> > >
> > > I am looking to do a SOAP Web service call and was told invokeHTTP may
> be
> > > able to work. Wonder how I would be able to do this. For example, using
> > > curl
> > > I could invoke SOAP like the below:
> > >
> > > curl -X POST -H "Content-Type: text/xml" -H "SOAPAction:
> > > "http://www.webserviceX.NET/GetCitiesByCountry"" --data-binary
> > > @request.xml
> > > http://www.webservicex.net/globalweather.asmx
> > >
> > > the request.xml:
> > > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> > > xmlns:web="http://www.webserviceX.NET">
> > >    <soap:Header/>
> > >    <soap:Body>
> > >       <web:GetCitiesByCountry>
> > >
> > >          <web:CountryName>CANADA</web:CountryName>
> > >       </web:GetCitiesByCountry>
> > >    </soap:Body>
> > > </soap:Envelope>
> > >
> > > I Appreciate the help!
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://apache-nifi-developer-list.39713.n7.nabble.com/SOAP-
> > Service-through-InvokeHTTP-tp13129.html
> > > Sent from the Apache NiFi Developer List mailing list archive at
> > > Nabble.com.
> > >
> >
>
>
>
> --
> Thanks,
> Andrew
>
> Subscribe to my book: Streaming Data <http://manning.com/psaltis>
> <https://www.linkedin.com/pub/andrew-psaltis/1/17b/306>
> twiiter: @itmdata <http://twitter.com/intent/user?screen_name=itmdata>
>
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Hitendra Kashyap
In reply to this post by Andrew Psaltis
Hi Jeff,

I am unable to use the NiFi-soap with the latest version of nifi (1.1.0).
after build and deploying nar file to lib when I restart nifi it doesn't
start. bootstrap log tail has following:

2016-12-15 01:25:05,216 INFO [main] org.apache.nifi.bootstrap.Command
Working Directory: /appl/idc/nifi-1.1.0
2016-12-15 01:25:05,217 INFO [main] org.apache.nifi.bootstrap.Command
Command: java -classpath
/appl/idc/nifi-1.1.0/./conf:/appl/idc/nifi-1.1.0/./lib/jcl-over-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/jul-to-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/log4j-over-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/logback-classic-1.1.3.jar:/appl/idc/nifi-1.1.0/./lib/logback-core-1.1.3.jar:/appl/idc/nifi-1.1.0/./lib/nifi-api-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-documentation-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-framework-api-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-nar-utils-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-properties-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-runtime-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/slf4j-api-1.7.12.jar
-Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m
-Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true
-Djava.awt.headless=true -XX:+UseG1GC
-Djava.protocol.handler.pkgs=sun.net.www.protocol
-Dnifi.properties.file.path=/appl/idc/nifi-1.1.0/./conf/nifi.properties
-Dnifi.bootstrap.listen.port=55731 -Dapp=NiFi
-Dorg.apache.nifi.bootstrap.config.log.dir=/appl/idc/nifi-1.1.0/logs
org.apache.nifi.NiFi
2016-12-15 01:25:06,323 INFO [NiFi Bootstrap Command Listener]
org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for
Bootstrap requests on port 55732
2016-12-15 01:26:07,036 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,072 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,104 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,126 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,456 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,646 ERROR [NiFi logging handler] org.apache.nifi.StdErr
[Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting
with element 'template'. One of '{controllerService}' is expected.



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/SOAP-Service-through-InvokeHTTP-tp13129p14237.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Hitendra Kashyap
In reply to this post by Andrew Psaltis
Hi Andrew,

I am unable to use the NiFi-soap with the latest version of nifi (1.1.0). after build and deploying nar file to lib when I restart nifi it doesn't start. bootstrap log tail has following:

2016-12-15 01:25:05,216 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /appl/idc/nifi-1.1.0
2016-12-15 01:25:05,217 INFO [main] org.apache.nifi.bootstrap.Command Command: java -classpath /appl/idc/nifi-1.1.0/./conf:/appl/idc/nifi-1.1.0/./lib/jcl-over-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/jul-to-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/log4j-over-slf4j-1.7.12.jar:/appl/idc/nifi-1.1.0/./lib/logback-classic-1.1.3.jar:/appl/idc/nifi-1.1.0/./lib/logback-core-1.1.3.jar:/appl/idc/nifi-1.1.0/./lib/nifi-api-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-documentation-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-framework-api-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-nar-utils-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-properties-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/nifi-runtime-1.1.0.jar:/appl/idc/nifi-1.1.0/./lib/slf4j-api-1.7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -XX:+UseG1GC -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=/appl/idc/nifi-1.1.0/./conf/nifi.properties -Dnifi.bootstrap.listen.port=55731 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/appl/idc/nifi-1.1.0/logs org.apache.nifi.NiFi
2016-12-15 01:25:06,323 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 55732
2016-12-15 01:26:07,036 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,072 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,104 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,126 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,456 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
2016-12-15 01:26:07,646 ERROR [NiFi logging handler] org.apache.nifi.StdErr [Error] :627:15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'template'. One of '{controllerService}' is expected.
Reply | Threaded
Open this post in threaded view
|

Re: SOAP Service through InvokeHTTP

Rashmi MR
In reply to this post by Jeff
how can i read data from soap service. What are the configuration properties
and where can i set the soap url and wsdl url uisng invokehttp?



--
Sent from: http://apache-nifi-developer-list.39713.n7.nabble.com/