XSD for receiving PDF files in Oracle Service Bus - rest

I am trying to write a service for Oracle Service Bus 12C to receive a PDF file.
The external service has two parameters of the format:
http://server.domain.com/documents?docId=12345&fetch=summary|document
If the parameter 'fetch' is sent with the value 'summary', it returns the summary information in JSON format. If the parameter value is 'document', it returns the PDF file with the Content-Type set as 'application/pdf'.
For the JSON response, the XSD is simple:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://TargetNamespace.com/DocServices_getFile_response"
targetNamespace="http://TargetNamespace.com/DocServices_getFile_response"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
elementFormDefault="qualified"
nxsd:version="JSON" nxsd:encoding="US-ASCII">
<xsd:element name="File-Proxy-Response-Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="docCode" type="xsd:integer"/>
<xsd:element name="docDescription" type="xsd:string"/>
<...snip...>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation xmlns="">
<xsd:appinfo>NXSDSAMPLE=</xsd:appinfo>
<xsd:appinfo>USEHEADER=false</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
But I can't figure out how to support receiving PDF response.

Related

Referenced file contains error at Liberty server.xml file

I am receiving the following error at server.xml file liberty server. I couldn't solve this problem.
Referenced file contains errors (file:/D:/workspaces/myprojects/.metadata/.plugins/com.ibm.ws.st.core/Liberty Runtime/server.xsd). For more information, right click on the message in the Problems View and
select "Show Details..."
**My server.xsd file **
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ext="http://www.ibm.com/xmlns/dde/schema/annotation/ext">
<xsd:complexType name="com.ibm.ws.app.manager.webappcfg">
<xsd:annotation>
<xsd:documentation>Defines the properties of a web application.</xsd:documentation>
<xsd:appinfo>
<ext:label>Web Application</ext:label>
</xsd:appinfo>
</xsd:annotation>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="startAfter" type="com.ibm.ws.app.manager-factory">
<xsd:annotation>
<xsd:documentation>Specifies applications that are required to start before this application can begin starting. </xsd:documentation>
<xsd:appinfo>
<ext:label>Start After</ext:label>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="classloader" type="com.ibm.ws.classloading.classloader">
.
.
.
I want to get rid of this error.
Error Details:
enter image description here

How can I use servicestack product so I can connect my Flutter or Dart to soap WSDL services?

I am trying to get my Flutter app to connect securely to soap/wsdl web services.
My question is how can I use servicestack product so I can connect my Flutter Mobile App or Dart console App to consume soap WSDL services?
Thanks
UPDATE:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://nick.mobile.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://nick.mobile.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://nick.mobile.com/">
<s:element name="C_getFilteredCustInfo_WithAssignNo">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AssignNo" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="clSecurityCheckBase" type="tns:cpSecurityCheckBase_WithAssignNo" />
<s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="cpSecurityCheckBase_WithAssignNo">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AssignNo" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OrgData" />
<s:element minOccurs="0" maxOccurs="1" name="HashData" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="IP" type="s:string" />
</s:sequence>
</s:complexType>
...
...
...
ServiceStack's Dart and Flutter support relies on using the JsonWebClient with generated Typed DTOs, e.g:
import 'package:servicestack/client.dart';
import 'techstacks.dtos.dart';
var client = new JsonServiceClient("https://www.techstacks.io");
main() async {
var response = await client.get(new GetTechnology(slug: "flutter"));
print("${response.technology.name}: ${response.technology.vendorUrl}");
}
Which only works with ServiceStack's JSON endpoints, so you wouldn't be able to use it to call SOAP Services directly.
Instead as ServiceStack support SOAP Services as an additional endpoint for your ServiceStack Services you could have the same Service available from both JSON as well as SOAP 1.1/1.2 clients.

Spring Batch job description missing in the JobBuilderFactory

In the Spring Batch job XML configuration there was the possibility to add a job description
<xsd:element name="job">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="description" type="description" minOccurs="0"/>
...
</xsd:sequence>
</xsd:element>
Questions:
Why is this not possible anymore in the Java configuration?
Spring Batch Admin has a column called Description, but it doesn't show anything.
As far as I can tell from the source code of both Spring Batch and Admin this is never stored/retrieved from the job repository. What is the reason behind it?

WSDL Complex Type Request Clarification

I am breaking my head to configure a complex type in a WSDL file and see that complex type in SOAP UI client.
Find below the WSDL file.
<?xml version ='1.0' encoding ='UTF-8' ?>
<wsdl:definitions name='Catalog'
targetNamespace='http://website.net/websitesmsmobile'
xmlns:tns='http://website.net/websitesmsmobile'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<types>
<xsd:complexType name="xsd:parameter">
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="xsd:parameters">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="parameter" type="tns:parameter"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</types>
<message name='callServerRequest'>
<part name='methodName' type='xsd:string'/>
<part name='parameter' type='paramters'/>
</message>
<message name='callServerResponse'>
<part name='response' type='xsd:string'/>
</message>
<portType name='websitePortType'>
<operation name='callServer'>
<input message='tns:callServerRequest'/>
<output message='tns:callServerResponse'/>
</operation>
</portType>
<binding name='websiteBinding' type='tns:websitePortType'>
<soap:binding
style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'
/>
<operation name='callServer'>
<soap:operation soapAction='urn:website-net-websitesmsmobile#callServer'/>
<input>
<soap:body
use='encoded'
namespace='urn:website-net-websitesmsmobile'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body
use='encoded'
namespace='urn:website-net-websitesmsmobile'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='websiteService'>
<port name='websitePort' binding='websiteBinding'>
<soap:address location='http://localhost/smsmobile/server/smsmobile.php'/>
</port>
</service>
</wsdl:definitions>
When I create a request in SOAP UI I see the below.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:website-net-websitesmsmobile">
<soapenv:Header/>
<soapenv:Body>
<urn:callServer soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<methodName xsi:type="xsd:string">?</methodName>
</urn:callServer>
</soapenv:Body>
</soapenv:Envelope>
The 'methodName' which is a string type got successfully generate. Why the complex type 'parameter' is not generated in the request?
Whats wrong in the WSDL file?
http://www.w3.org/TR/2001/NOTE-wsdl-20010315
(Example 5. SOAP binding of request-response RPC operation over HTTP)
GO through above link at example 5. Your schema definition is not correct at binding, thats why it is not showing your request message properly.

Communicating to WSDL using SOAP, I don't know how to form correctly my SOAP to interact with the WSDL in a remote server

I have to make a request to a web service, that uses Axis2, I'm too close to have it working but i keep getting error messages and i'm sure it is in the construction of my SOAP XML. This was the SOAP:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<operation>
<name>getSPToken</name>
<input>http://zzz.zzz.zzz.zzz/my/redirection/url/</input>
</operation>
</soap:Body>
</soap:Envelope>
UPDATE!!!! Now the soap is this:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<RequestsoapHeader>
<spId>SPID</spId>
<spPassword>RandomPass</spPassword>
<timeStamp>20130115160251</timeStamp>
</RequestsoapHeader>
</soap:Header>
<soap:Body>
<getSPTokenRequest>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
</soap:Envelope>
The part i can't fix is the Body, i tried to call the operation in different ways, for example instead of <operation> i used <operation name="getSPToken">, i also tried not using operation and created a tag with the name: <getSPToken>, but nothing works.
This is the WSDL part that describes the operation i'm trying to call in the Web Service:
<wsdl:operation name="getSPToken">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
UPDATE!!! This is the interface XML (part of the WSDL) that i didn't post before:
<wsdl:types>
<xsd:schema elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<xsd:element name="getSPTokenRequest" type="osg_sicoweb_local_xsd:getSPTokenRequest"/>
<xsd:complexType name="getSPTokenRequest">
<xsd:sequence>
<xsd:element name="SPredirectURL"
type="xsd:string" maxOccurs="1" minOccurs="1">
<xsd:annotation>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getSPTokenResponse" type="osg_sicoweb_local_xsd:getSPTokenResponse"/>
<xsd:complexType name="getSPTokenResponse">
<xsd:sequence>
<xsd:element name="SPToken" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
And this is the response i was getting:
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Date: Tue, 15 Jan 2013 21:10:49 GMT
Connection: close
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:axis2ns73="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>axis2ns73:Client</faultcode>
<faultstring>The endpoint reference (EPR) for the Operation not found is http://xxx.xxx.xxx.xxx:xxx/path/to/service/ and the WSA Action = </faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
UPDATE!!!! With the new changes, the response i'm getting is this one:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>org.apache.axis2.databinding.ADBException: Unexpected subelement getSPTokenRequest</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The operation getSPToken receives one parameter called SPredirectURL, that contains a URL of redirection, please help.
Try one of the following as your body:
<soap:Body>
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</soap:Body>
<soap:Body>
<getSPTokenRequest xmlns="http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local">
<SPredirectURL>http://zzz.zzz.zzz.zzz/my/redirection/url/</SPredirectURL>
</getSPTokenRequest>
</soap:Body>
Based on the WSDL snippet, the web service endpoint is using the document/literal convention for messages, but without the WSDL message declarations it is unclear whether the 'bare' (first example) or 'wrapped' (second example) version is expected. The post at this address (http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/) gives good insight into the various dialects described by WSDL.
UPDATE:
Based on the schema inside the wsdl:types section, the fully-qualified name for the element expected by the service (based on the declared targetNamespace attribute of the schema element) is http://www.csapi.org/schema/parlayx/sicoweb/v1_0/local{getSPTokenRequest}
One way of establishing that name (inline namespace declaration) is shown in the updated second body above.
Post back with the next iteration.