I am using Filenet 5.2.1 soap webservice GetContent :
http://myserver:9080/wsi/FNCEWS40MTOM.wsdl
and when trying to get content for a file that is larger than 1 MB, the returned response when read as base64 is only for part of the file not the whole file.
my request is as follows :
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<hd:UsernameToken xmlns:hd="http://schemas.xmlsoap.org/ws/2002/12/secext">
<hd:Username>myusername</hd:Username>
<hd:Password>mypassword</hd:Password>
</hd:UsernameToken>
</Security>
</soapenv:Header>
<soapenv:Body>
<p857:GetContentRequest validateOnly="0" xmlns:p857="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
<p857:ContentRequest cacheAllowed="1" id="1" startOffset="0">
<p857:SourceSpecification classId="Document" itemIndex="0" objectId="{E408981D-FF67-4D91-B7A9-CEBEC4630AB0}" objectStore="myobjectstore"
serializationDuplicate="0" xsi:type="p857:ObjectSpecification"/>
<p857:ElementSpecification elementSequenceNumber="0" itemIndex="0"/>
</p857:ContentRequest>
</p857:GetContentRequest>
</soapenv:Body>
</soapenv:Envelope>
Response :
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z
Content-Transfer-Encoding: binary
Content-Type: application/xop+xml; type="application/soap+xml"; charset=UTF-8
Content-ID:
<v0-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com>
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
<e:Body>
<GetContentResponse xmlns="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
<ContentResponse id="1" i:type="fn40:ContentElementResponse" retrievalName="test.pdf" totalSize="4586622" bufferedSize="1048576" continueFrom="offset=1048576;id={B3795692-DA06-468C-AEC9-523A3715455D};">
<SourceSpecification i:type="fn40:ObjectReference" classId="Document" objectId="{E408981D-FF67-4D91-B7A9-CEBEC4630AB0}" objectStore="MCIDEV"></SourceSpecification>
<ElementSpecification elementSequenceNumber="0"></ElementSpecification>
<Content i:type="fn40:InlineContent">
<Binary>
<xop:Include href="cid:v1-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com"></xop:Include>
</Binary>
</Content>
</ContentResponse>
</GetContentResponse>
</e:Body>
</e:Envelope>
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream
Content-Id:
<v1-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com>
%PDF-1.4
......
......
......
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z--
The problem was in filenet configuration :
Inline Content Retrieval Limit default is 1 MB so that filenet webservice itself was returning 1 MB only of the file.
Increasing the value fixed the issue, but unfortunately the maximum is 10 MB.
https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=engine-improving-content-uploads-downloads
Related
I'm trying to use the sync-collection operation of Google CardDAV API. It's not well explained in the documentation. But I think following is what they have explained in this documentation.
First, discover the sync-token from address book using propfind operation. Following is my request and I get the sync-token successfully.
Request
Depth: 0
Content-Type: application/xml; charset=utf-8
<d:propfind xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
<d:prop>
<d:displayname />
<cs:getctag />
<d:sync-token />
</d:prop>
</d:propfind>
Response
ncoding="UTF-8"?>
<d:multistatus xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:ical="http://apple.com/ns/ical/">
<d:response>
<d:href>/carddav/v1/principals/some#email.com/lists/default/</d:href>
<d:propstat>
<d:status>HTTP/1.1 200 OK</d:status>
<d:prop>
<d:displayname>Address Book</d:displayname>
<d:sync-token>https://www.googleapis.com/carddav/v1/synctoken/SOMEIDINHERE</d:sync-token>
<cs:getctag>"23fq3fqefas.8"</cs:getctag>
</d:prop>
</d:propstat>
</d:response>
</d:multistatus>
Then we have to do a sync-collection operation with sync-token to get changes from the previous state, but that doesn't return any item, regardless of whatever the change I do in my contact list at https://contacts.google.com/.
Request
<?xml version="1.0" encoding="utf-8" ?>
<d:sync-collection xmlns:d="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
<d:sync-token>https://www.googleapis.com/carddav/v1/synctoken/SOMEIDINHERE</d:sync-token>
<d:sync-level>1</d:sync-level>
<d:prop>
<d:displayname />
<d:current-user-principal />
<d:principal-URL/>
</d:prop>
</d:sync-collection>
Response
<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:ical="http://apple.com/ns/ical/">
<d:sync-token>https://www.googleapis.com/carddav/v1/synctoken/SOMEIDINHERE </d:sync-token>
</d:multistatus>
Please let me know what am I doing wrong.
In general, the normal mode of operation is to issue a first sync-collection with an empty sync-token (see https://www.rfc-editor.org/rfc/rfc6578#section-3.8 ) and use the sync-token returned in the response in following requests.
I am trying to get the pan info from the income tax of india web API.
The standard XML for the request is this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pan="http://panws.dit.tcs.com/" xmlns:typ="http://panws.dit.tcs.com/types/">
<soapenv:Header/>
<soapenv:Body>
<pan:getPanInfo>
<login>
<typ:userName>xxxxxxxxx</typ:userName>
<typ:password>xxxxxxxxxx</typ:password>
</login>
<panNo>
<typ:panNo>xxxxxxxxxxxxx</typ:panNo>
</panNo>
</pan:getPanInfo>
</soapenv:Body>
</soapenv:Envelope>
I am using SAVON ruby gem to submit the request in the above format. My code is
client = Savon.client do |globals|
globals.wsdl 'https://incometaxindiaefiling.gov.in/e-FilingWS/ditws/PanWS.wsdl'
end
client.call(:get_pan_info, message: {
"login" => {
"typ:userName" => "xxxxxxxxxx",
"typ:password" => "xxxxxxxxxxxxxxxx"
},
"panNo" => {
"typ:panNo" => "xxxxxxxxxxxxxxx"
}
})
It creates the XML to be submitted is here:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://panws.dit.tcs.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://panws.dit.tcs.com/types/">
<env:Body>
<tns:getPanInfo>
<tns:login>
<typ:userName>xxxxxxx</typ:userName>
<typ:password>xxxxxxxxxxxx</typ:password>
</tns:login>
<tns:panNo>
<typ:panNo>xxxxxxxxxxxxxx</typ:panNo>
</tns:panNo>
</tns:getPanInfo>
</env:Body>
</env:Envelope>
and it gives 500 External server Error,
Can any body please point me out where i am wrong or how to create the same XML for the request.
You should set the correct env_namespace :
Savon.client(env_namespace: :soapenv)
Ctrl+F for env_namespace here
I have a problem consuming an OData-service in a Windows 8 store application.
If I do this:
IEnumerable<vw_mobSurveyor> lstSurveyors =
await ((DataServiceQuery<vw_mobSurveyor>)ODataContext.vw_mobSurveyor
.AddQueryOption("$filter", "intSurveyorID eq " + intID.ToString()))
.ExecuteAsync("GetByID").ConfigureAwait(false);
it works and the end of the URI is: /vw_mobSurveyor?$filter=intSurveyorID eq 1. This URI also works if I try it in a browser, so all is well.
But if I do :
IEnumerable<vw_mobSurveyor> lstSurveyors =
await ((DataServiceQuery<vw_mobSurveyor>)ODataContext.vw_mobSurveyor
.Where(s => s.intSurveyorID == intID))
.ExecuteAsync("GetByID").ConfigureAwait(false);
This fails with a Client Internal Error 4. It produces a different ending to the URI: /vw_mobSurveyor(2) This URI fails when I try it in a browser, and that is why it fails when the code generates it.
I have read these two should be equivalent in the produced URI: http://msdn.microsoft.com/en-us/library/ee622463.aspx#filtering.
As I would like to pass a Linq expression in future, so I need to get the second version to work. So how do I force the second version to use $filter so it works?
Update : Fiddler output for working code using $filter
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 1057
Content-Type: application/atom+xml;type=feed;charset=utf-8
Server: Microsoft-IIS/7.0
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 18 Jan 2013 11:35:34 GMT
<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="http://MYSERVER/TESTAPP%20V1/DataService.svc/"
xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<id>http://MYSERVER/TESTAPP%20V1/DataService.svc/vw_mobSurveyor</id>
<title type="text">vw_mobSurveyor</title>
<updated>2013-01-18T11:35:34Z</updated>
<link rel="self" title="vw_mobSurveyor" href="vw_mobSurveyor" />
<entry>
<id>http://MYSERVER/TESTAPP%20V1/DataService.svc/vw_mobSurveyor(2)</id>
<category term="SurveyProModel.vw_mobSurveyor" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" title="vw_mobSurveyor" href="vw_mobSurveyor(2)" />
<title />
<updated>2013-01-18T11:35:34Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:intSurveyorID m:type="Edm.Int32">2</d:intSurveyorID>
<d:vchName>Bob Green 2</d:vchName>
<d:vchStatus>Surveyor</d:vchStatus>
</m:properties>
</content>
</entry>
</feed>
Update : Fiddler output for failing code
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 824
Content-Type: application/atom+xml;type=entry;charset=utf-8
Server: Microsoft-IIS/7.0
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 18 Jan 2013 11:33:30 GMT
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="http://MYSERVER/TESTAPP%20V1/DataService.svc/"
xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<id>http://MYSERVER/TESTAPP%20V1/DataService.svc/vw_mobSurveyor(2)</id>
<category term="SurveyProModel.vw_mobSurveyor" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" title="vw_mobSurveyor" href="vw_mobSurveyor(2)" />
<title />
<updated>2013-01-18T11:33:30Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:intSurveyorID m:type="Edm.Int32">2</d:intSurveyorID>
<d:vchName>Bob Green 2</d:vchName>
<d:vchStatus>Surveyor</d:vchStatus>
</m:properties>
</content>
</entry>
This seems like a bug in the WCF Data Services client.
At first glance, I don't see any issues in the Fiddler traces you provided, but I'll try to reproduce this on my end and I'll file an internal bug for this. If you have a full stack trace of the error, that would be very helpful.
Just to note: the LINQ-to-URI translation bit is doing the correct thing here. If a .Where clause is only checking the key value of an entity, we optimize the query by directly looking up the entity by its key (i.e., ../vw_mobSurveyor(2)) instead of using the $filter mechanism. This will result in an entry response payload instead of a feed, which matches what you got from Fiddler.
And to answer your original question, you could force the LINQ translator to use $filter by making the predicate involve anything other than the just the entity key. For example, you could do something like:
.Where(s => s.intSurveyorID == intID && true)
This is obviously a hack, but it should work. Ideally, we'll find and fix this bug and you can then use a more normal-looking Where clause :).
It looks like you are querying a view; have you set the entity key property in your entity model?
I'm attempting to utilize the ruby gem Savon to connect to a web service provided by propertyware (http://propertyware.com/apidocs/Getting-Started). I've successfully connected to the service via SoapUI and executed an echoString request. When I try to do the same via Ruby I get a null user authentication error.
Here's what I've tried in Ruby...
require 'rubygems'
require 'savon'
client = Savon::Client.new do
wsdl.document = 'http://propertyware.com/pw/services/PWServices?wsdl'
wsse.credentials 'username', 'pwd'
end
response = client.request :web, :echo_string, :body => {:arg => "Hello world."}
Which produces the following xml...
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://propertyware.com/pw/services/PWServices"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ins0="http://propertyware.com/pw/services/PWServices"
xmlns:ins1="http://criteria.soap.propertyware.com"
xmlns:ins2="urn:PWServices"
xmlns:ins3="http://soap.propertyware.com"
xmlns:ins4="http://xml.apache.org/xml-soap">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">pwd</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
<web:echoString>
<arg>Hello world.</arg>
</web:echoString>
</env:Body>
</env:Envelope>
Here's the xml produced by SoapUI...
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://webservices" >
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">pwd</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">R41mCRd+tY+xthhE/YISLQ==</wsse:Nonce>
<wsu:Created>2011-10-25T09:52:40.220Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<web:echoString soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<arg xsi:type="xsd:string">?</arg>
</web:echoString>
</soapenv:Body>
</soapenv:Envelope>
One obvious difference is that SoapUI includes a nonce key and a createdAt timestamp. I'm not sure how to make savon do that without moving to digest auth. (and fwiw that doesn't work).
I'm not real savoy in the ways of web services - any guidance would be much appreciated.
Also - here's the response when I attempt to connect via savon:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.Unauthenticated</faultcode>
<faultstring>User 'null' not authenticated (unknown user)</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">rcpppwwwapt012.realpage.com</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
TIA!
Bob
Try setting the digest in the wsse to true. This will instruct Savon to add the nonce and createdAt to the request:
wsse.credentials 'username', 'pwd', :digest
See the comments of this object for more info
In Savon version 2 you need following:
client = Savon.client do
wsdl 'https://webservice/theservice.wsdl'
wsse_auth("user", "pass", :digest)
end
I believe the first step would be to deal with the error.
<faultstring>User 'null' not authenticated (unknown user)</faultstring>
Your credentials aren't being passed to the service.
I have the following WSDL, generated from soapUI. When I test the
request from soapUI, it works fine but throws exception from savon.
I am using savon 0.9.2 on Linux.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:mes="http://www.domain.com/sub/05/00/Messages">
<soapenv:Header/>
<soapenv:Body>
<mes:loginRequest>
<!--Optional:-->
<mes:Username>admin</mes:Username>
<!--Optional:-->
<mes:Password>pass</mes:Password>
<!--Optional:-->
<mes:ImpersonationUsername></mes:ImpersonationUsername>
<!--Optional:-->
<mes:ApplicationName></mes:ApplicationName>
</mes:loginRequest>
</soapenv:Body>
</soapenv:Envelope>
The script, which causes Errors:
require 'rubygems'
require 'savon'
require 'pp'
client = Savon::Client.new "http://domain/Service.asmx?WSDL"
response = client.request(:mes, "login") do
soap.body = {
"mes:Username" => "test",
"mes:Password" => "test",
"mes:ImpersonationUsername"=>"Test",
"mes:ApplicationName"=>"test"
}
end
pp response.to_hash
The Output:
D, [2011-05-10T16:06:14.316827 #11254] DEBUG -- : <?xml version="1.0"
encoding="utf-8"?><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><LoginResult xmlns="http://www.domain.com/sub/
05/00/
Messages"><ErrorDetails><Items><SfExceptionItem><ExceptionType>System.NullReferenceException</
ExceptionType><AssemblyName>mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b73a5c561934e089</
AssemblyName><Message>Object reference not set to an instance of an
object.</Message></SfExceptionItem></Items><FaultCode>UnknownError</
FaultCode><Message>Object reference not set to an instance of an
object.</Message></ErrorDetails></LoginResult></soap:Body></
soap:Envelope>
{:login_result=>
{:error_details=>
{:items=>
{:sf_exception_item=>
{:message=>"Object reference not set to an instance of an
object.",
:exception_type=>"System.NullReferenceException",
:assembly_name=>
"mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b73a5c561934e089"}},
:message=>"Object reference not set to an instance of an
object.",
:fault_code=>"UnknownError"},
:xmlns=>
"http://www.domain.com/sub/05/00/Messages"}}
The output from SoapUI is the following:
<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>
<LoginResult xmlns="http://domain/sub/05/00/Messages">
<UserTicket>95bfaa81149f4c118c8724b837235cd5</UserTicket>
</LoginResult>
</soap:Body>
</soap:Envelope>
You might want to set the namespace in your savon request: client.namespaces["xmlns:mes"] = "http://www.domain.com/sub/05/00/Messages"
the request you send creates the following soap message
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mes="urn:namespace.com"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<mes:login>
<mes:Username>test</mes:Username>
<mes:Password>test</mes:Password>
<mes:ImpersonationUsername>Test</mes:ImpersonationUsername>
<mes:ApplicationName>test</mes:ApplicationName>
</mes:login>
</env:Body>
I guess that's not what your intention is?
please insert the following lines into your code after the .new
Savon.configure do |c|
c.log = true
end
that shows the outgoing message.