Windows Web Services - Unsupported media type
Hi,
I'm trying to migrate a web service from .NET WCF to C++ Windows Web Services API. I generated .c and .h files using WSDL, create few wrappers and incorporated it into the C++ code and try it using a gSOAP client. Sadly, it wasn't working.
Here is the response from the WWS:
HTTP/1.1 415 Unsupported Media Type
Server: Microsoft-HTTPAPI/2.0
Date: Mon, 14 Jul 2014 10:50:23 GMT
Connection: close
Content-Length: 0
I debug it for a while, and found out, that WWS apparentely cannot handle action parameter in Content-Type.
Content-Type: text/xml; charset=utf-8; action="http://tempuri.org/IReferenceClockWebService/SetRecordTimeLeftDiff"
After I remove the action parameter, everything is working.
Why is this happening. Isn't an action parameter common part of SOAP HTTP requests? Is there any workaround?
Thanks in advance.
Hi,
I'm trying to migrate a web service from .NET WCF to C++ Windows Web Services API. I generated .c and .h files using WSDL, create few wrappers and incorporated it into the C++ code and try it using a gSOAP client. Sadly, it wasn't working.
Here is the response from the WWS:
HTTP/1.1 415 Unsupported Media Type
Server: Microsoft-HTTPAPI/2.0
Date: Mon, 14 Jul 2014 10:50:23 GMT
Connection: close
Content-Length: 0
I debug it for a while, and found out, that WWS apparentely cannot handle action parameter in Content-Type.
Content-Type: text/xml; charset=utf-8; action="http://tempuri.org/IReferenceClockWebService/SetRecordTimeLeftDiff"
After I remove the action parameter, everything is working.
Why is this happening. Isn't an action parameter common part of SOAP HTTP requests? Is there any workaround?
Thanks in advance.
Similar Messages
-
Getting 415 Unsupported Media Type error when calling a windows web service
I have a BPEL process that invokes a windows web service. This process is working currently on the production system. When trying to run the process in a new test clustered environment, I'm getting the error below (bolded).
We're using 10.1.3.3 Oracle Application Server and BPEL. Please advise on what config files might need to be tweaked to fix this.
InvokeWindowsLoggingWebService(faulted)
[2010/04/16 17:26:35] Faulted while invoking operation "WriteLog" on provider "WindowsLoggingWebService". less
-<messages>
-<input>
-<InvokeWindowsLoggingWebService_InputVariable>
-<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="parameters">
-<WriteLog xmlns="http://tempuri.org/">
<FileAbsolutePath>
R:\CV & RM\upload_from_test.log
</FileAbsolutePath>
<Content>
||*************************************************************************************|Append to log file 2010-04-16T16:57:08-04:00|*************************************************************************************||START DATE: 2010-04-16T16:57:08-04:00|END DATE: 2010-04-16T17:25:58-04:00|COUNT: 106|TRANSFER OF FILES TO TAS SUCCESSFUL
</Content>
<NewLineDelimiter>
|
</NewLineDelimiter>
</WriteLog>
</part>
</InvokeWindowsLoggingWebService_InputVariable>
</input>
-<fault>
-<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="summary">
<summary>
exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type
</summary>
</part>
</remoteFault>
</fault>
</messages>
[2010/04/16 17:26:35] "{http://schemas.oracle.com/bpel/extension}remoteFault" has been thrown. less
-<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="summary">
<summary>
exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type
</summary>
</part>
</remoteFault>I generated a proxy service in jdev and used the same parms as was done on OAS...
<WriteLog xmlns="http://tempuri.org/">
<FileAbsolutePath>
R:\CV & RM\upload_from_test.log
</FileAbsolutePath>
<Content>
||*************************************************************************************|Append to log file 2010-04-16T16:57:08-04:00|*************************************************************************************||START DATE: 2010-04-16T16:57:08-04:00|END DATE: 2010-04-16T17:25:58-04:00|COUNT: 106|TRANSFER OF FILES TO TAS SUCCESSFUL
</Content>
<NewLineDelimiter>
|
</NewLineDelimiter>
</WriteLog>
and was able to call the service fine and it returned successful. Just seems to be an issue on the server when I execute it from there. -
PowerPoint Web App 415 Unsupported Media Type
Hi,
i had successfully deployed and configured external access via TMG to SharePoint 2013 with Office Web Apps 2013. Everything works fine, except PowerPoint Web App, when the farm is accessed externally. User becomes following error message:
Either you´ve lost network connectivity or our server is too busy to handle your request. Please check your network connection and try again later.
PowerPoint Web App is working fine, when accessing SharePoint form local network or through VPN.
Ive searched TMG Logs and found this 415 ERROR:
Allowed Connection
Log type: Web Proxy (Reverse)
Status: 415 Unsupported Media Type
Rule: (SERVER FQDN)
Source: Internal ()
Destination: Local Host ()
Request: POST http://(SERVER FQDN)/p/ppt/view.https.svc/jsonNtlm/GetPresentation
Filter information: Req ID: 0be8d6bf; Compression: client=Yes, server=No, compress rate=0% decompress rate=0% ; FBA cookie: exists=yes, valid=yes, updated=no, logged off=no, client type=public, user activity=yes
Protocol: https
User: domain\name
Additional information
Client agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Object source: Internet (Source is the Internet. Object was added to the cache.)
Cache info: 0x40020000 (Response includes the CACHE-CONTROL: PRIVATE header. Response should not be cached.)
Processing time: 16 MIME type:
Thank you for answers!
Regards
LubomirI'm going to move this to the TMG forum as it is more of a TMG-related issue (clearly WAC works fine when not taking TMG int account).
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
Hi,
Posting in the 'General' forums as well. Did not yet get any response for the topic posted in the 'Configuration and Getting Started Discussion' forum.
I am having nightmares to call the POST method of a REST service thru Flex. Initially tried with the HTTPService without any proxy server. Wasn't able to call POST, though the GET method was successfully called. Please see the post here (http://www.flexdeveloper.eu/forums/actionscript-3-0/how-to-acces-post-method-of-rest-web -service-thru-flex/)
b THEN I tried with BlazeDS
, but with the same results!
I have set up BlazeDS with the integrated Tomcat option. I have also set up the Flex project as mentioned in the instructions. It is working fine when I run the sample projects.
But the problem is that
i when I try to access a
b POST for a REST service,
i I get the "HTTP/1.1 415 Unsupported Media Type" fault.
b The complete fault I'm getting is: [RPC Fault faultString="HTTP/1.1 415 Unsupported Media Type" faultCode="Server.Proxy.Request.Failed" faultDetail="HTTP/1.1 415 Unsupported Media Type"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev \3.1.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:218]
at mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53 ]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at HTTPMessageResponder/resultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messagin g\channels\HTTPChannel.as:871]
at HTTPMessageResponder/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messag ing\channels\HTTPChannel.as:940]
at ChannelRequestLoader/callEventCallback()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\mess aging\channels\HTTPChannel.as:1155]
at ChannelRequestLoader/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messag ing\channels\HTTPChannel.as:1191]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I have added correct entry to the policy-config.xml (I know this because the GET for the same REST service is working).
b Only the POST thing is giving me the fault!
Appreciate any inputs. (am in need of 'em badly)
thanks
BJGMy guess is that the Server/Rest service doesn't like the content type of the request. HTTPService uses a content type of application/x-www-form-urlencoded by default. Maybe the Rest service is expecting the request to be XML? If that's the case, you need to set the contentType property of the HTTPService to application/xml.
Sometimes an HTTP sniffer/proxy such as Charles can be useful for debugging these kinds of issues. If my suggestion doesn't help, capture the HTTP request and response using a HTTP sniffer like Charles and post back to this thread with it and someone will take a look at it for you. Thanks.
-Alex -
HTTP 415 Unsupported Media Type with SOAP adapter trying to put SOAP header
Hello,
I am trying to put data into soap header using soap receiver adapter. Seems like building the complete soap message is the right way to go. Thus I wrote a java program to build the complete soap message (soap envelop, soap header and soap body which contains the message PI received from the sender). Mapping program works well. However when I ran the scenario, I got Error "SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 415 Unsupported Media Type" when calling the receiver's web service (the SOAP receiver adapter CC have the "Do Not use SOAP Envelop" checked). Anyone knows why I got this error? From google, seems like this error is because the http's content-type is set to other type, rather than "text/xml". However in soap CC there is no option to control this.
The message sent to the receiver is (after mapping);
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<SOAP-SEC:Signature xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12" MyAttr="value">My Test Value</SOAP-SEC:Signature>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:UpdateEquipment xmlns:ns1="http://mycomp.com/mywebservice">
<ns1:EquipmentNumber>000000012345</ns1:EquipmentNumber>
<ns1:LicensePlate>654321</ns1:LicensePlate>
</ns1:UpdateEquipment>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Anyone can help?
ThanksWhen you check "Do Not use SOAP Envelop", the SOAP adapter chooses application/xml instead of text/xml.
You can change the content type with help of the MessageTransformBean. You put the bean in the module chain of the receiver channel and add the parameter Transform.ContentType = text/xml
See
http://help.sap.com/saphelp_nwpi71/helpdata/EN/57/0b2c4142aef623e10000000a155106/frameset.htm -
QuickTime Player says its an unsupported media type
Created a .mov file from iMovie 08. It will play just fine on any Windows PC if the file is local. When I try to stream it off the QTSS I get an error that it's an unsupported media type. I know I'm missing something simple. Suggestions are welcomes
Yep...$30 bucks fixed my problem. Installed QuickTime Pro and export file as a hinted file fixed the issue.
-
ADAPTER.HTTP_EXCEPTION - HTTP 415 Unsupported Media Type
Hi All,
We have a Proxy to SOAP scenario which is throwing the below response.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Inbound Message
-->
- <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 415 Unsupported Media Type</SAP:AdditionalText>
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
We have used XSLT mapping and also used the Message transform bean (ocalejbs/AF_Modules/MessageTransformBean) with the module parameters.
Please help.this is the Audit log... Just in case this helps..
20.10.2011 09:57:34 Information Transform: successfully transformed
20.10.2011 09:57:34 Information MP: processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
20.10.2011 09:57:34 Information SOAP: request message entering the adapter with user J2EE_GUEST
20.10.2011 09:57:34 Information SOAP: completed the processing
20.10.2011 09:57:34 Information SOAP: continuing to response message 765df5dd-fb23-11e0-a52b-0000124b6826
20.10.2011 09:57:34 Error SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
20.10.2011 09:57:34 Error MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
20.10.2011 09:57:34 Error Adapter Framework caught exception: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
20.10.2011 09:57:34 Error Delivering the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error. Setting message to status failed.
20.10.2011 09:57:34 Error The message status was set to FAIL. -
HotFix 2 breaks web service results of type xsd:anyType
I have a client that accesses a number of web services that
return results as type xsd:anyType (the results are complex XML
hierarchies that change according to db values). Before HotFix 2,
in in my ResultEvent.RESULT event handler, I could get access to
the result via the ResultEvent.result property. But since HotFix 2,
the ResultEvent.result property is always null for web services
results of type xsd:anyType (for other result types,
ResultEvent.result is correct).
This is a major nuisance!! I assume this is a bug, so can
anyone suggest any workarounds while I wait for Adobe to fix it? I
can access the result as a string via the EventResult.message.body
member. And from there, I can parse the XML, and perform an
XML-to-ValueObject conversion... does that sound reasonable? Does
anyone have an examples of XML-to-ValueObject conversion code to
help get me started?
Any hints or tips would be most welcome ;)
Thanks!
Paul C.This has become a huge problem for me... it's boken my
applications in *many* places :(
Is there no-one with any suggestions?
Paul C. -
Can "SPML Web Service Complex Data Type field" take multiple values ?
In Generic Technology Connector's -SPML design parameters section, Can we give multiple values in SPML Web Service Complex Data Type field?
If not, how can i call methods directly instead of calling them through a values of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type?
I need 'SPML Web Service Complex Data Type' to hold multiple values.And based on the request it has to initiate appropriate method of action.
Presently i have three methods add,modify and delete which i am calling through a single value of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type.
I want to replace this single value with multiple menthods , so that a direct interaction between the method,OIM and target can be established.
Edited by: 821054 on 16/02/2011 04:23Thanks Robert.
You'll need to create your own interface to the webapp database for those kind of data operations
by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
I'm curious if anyone else has tried this?
Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
Web App item field value (as recorded against the List (Checkbox List) field type:
8294877,8294878
Web App Search value (for this same field):
8294879,8294877,8294885
The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets). -
HTTP 415 Unsupported Media Type with SOAP adapter ?
Hello All,
Iam getting HTTP 415 Unsupported Media Type with SOAP adapter error while executing the scenario.
i got one thread which have the solution. iam not getting exactly how to write message transform Bean.
HTTP 415 Unsupported Media Type with SOAP adapter trying to put SOAP header
Please tell me where i need to write the MessageTransformBean at sender adapter or receiver file adapter.
Thanks and regards,
chinnaHi Chinna,
Have you checked this
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Regards
Ramesh -
Add item to list gives : 415 - Unsupported Media Type
Hello,
I would like to add an item to a custom list using rest API.
The request gave me : Unsupported Media Type
I am using the list custom type name (SP.Data.%name%ListItem) as type in __metadata following the information here : http://msdn.microsoft.com/en-us/library/office/dn531433(v=office.15).aspx#bk_ListItem
I am able to add attachments to an existing item but i can't add a new item.
Do you have any idea?
Thanks in advance.
Regards,Rajesh,
The error definitely says request sent by the client especially the content-type header is not a valid one. Check this trace and ask them to change accordingly:
http://help.sap.com/saphelp_nw04/helpdata/en/8f/2f2c4142aef623e10000000a155106/content.htm
Regards,
---Satish -
Unable to invoke endpoint uri : 415 unsupported media type
Hi all,
I'm trying to invoke a HTTP Binding with POST where the endpoint is a RESTFUL webservice that takes in an XML message and sends an email.
I'm using JDeveloper 11g to create the composite where it'll have an exposed HTTP Binding POST and an external reference which is also a HTTP Binding POST that calls a RESTFUL Webservice endpoint . In the BPEL process, i'm just doing a simple receive from the exposed HTTP Binding and then using the input to invoke the External References HTTP Binding. However, I'm always getting an error at the invoke phase :
<part name="summary">
<summary>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</summary>
</part>
<part name="detail">
<detail>Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</detail>
</part>
<part name="code">
<code>415</code>
</part>
I'm guessing that it's because my payload is lacking the HTTP header content-type : application/xml. The webservice endpoint itself is working fine as I'm able to test it through other means such as POSTMan and soapUI.
Is there a way to set the HTTP header content-type of the payload? Is there anyway to check or verify? Any help would be greatly appreciated.
Regards,
MarkHi all,
I'm trying to invoke a HTTP Binding with POST where the endpoint is a RESTFUL webservice that takes in an XML message and sends an email.
I'm using JDeveloper 11g to create the composite where it'll have an exposed HTTP Binding POST and an external reference which is also a HTTP Binding POST that calls a RESTFUL Webservice endpoint . In the BPEL process, i'm just doing a simple receive from the exposed HTTP Binding and then using the input to invoke the External References HTTP Binding. However, I'm always getting an error at the invoke phase :
<part name="summary">
<summary>oracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</summary>
</part>
<part name="detail">
<detail>Unable to invoke endpoint URI "http://xxxxxxxxx/xxxx/xxxx/sendEmail" successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 415 Unsupported Media Type from url http://xxxxxxxxx/xxxx/xxxx/sendEmail</detail>
</part>
<part name="code">
<code>415</code>
</part>
I'm guessing that it's because my payload is lacking the HTTP header content-type : application/xml. The webservice endpoint itself is working fine as I'm able to test it through other means such as POSTMan and soapUI.
Is there a way to set the HTTP header content-type of the payload? Is there anyway to check or verify? Any help would be greatly appreciated.
Regards,
Mark -
Response code - 415 Unsupported Media Type
Dear All,
We are trying a scenario to simply receive data from one of our external partners, via HTTP, and save this data as a flat file within our landscape.
As there is no mapping involved, no object is created/referred to in the integration repository.
However, our partners get response "415 Unsupported Media Type" when sending data to us.
Data that is being sent, has the following headers,
Content-Type: application/text
Content-Transfer-Encoding: binary
Could one of you please help to resolve this issue?
Kind Regards,
Thomas.Could your sender system send the data in different Content-Type e.g. application/xml or text/xml. If not, then you need to use the MessageTransformBean to convert Content-Type: application/text to one of the above.
http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
Regards,
Prateek -
Unsupported media type:application/vnd.rim.cod
Hullo!
I have a Blackberry Curve 8320, and am trying to download the new (and apparantly award-winning) Nimbuzz IM client to my phone via their site at http://get.nimbuzz.com but am getting an error when I try.
First I am told "The item you selected cannot be displayed. Do you wish to save the item?" If I select No, I get "Unsupported media type:application/vnd.rim.cod"
Saving the file "Nimbuzz-1.cod" and then trying to Explore to it and launch it doesn't seem to do any good either.
I was pretty sure .cod files are the correct file type for this sort of thing, and I can't find anything on the Internet about this error message, or anyone else experiencing this problem.
Please help!Hi Im having the same problem, and i havent found anything about it. Did you fix it? can you please tell me how?
Thanks -
Error while deploying a web service whose return type is java.util.Date
Hi
I have written a simple web service which takes in a date input (java.util.Date) and returns the same date back to the client.
public interface Ping extends Remote
* A simple method that pings the server to test the webservice.
* It sends a datetime to the server which returns the datetime.
* @param pingDateRequest A datetime sent to the server
* @returns The original datetime
public Date ping(Date pingDateRequest) throws RemoteException;
The generation of the Web service related files goes smoothly in JDeveloper 10g. The problem arises when I try to deploy this web service on the Oracle 10g (10.0.3) OC4J standalone. it gives me the following error on the OC4J console :
E:\Oracle\oc4j1003\j2ee\home\application-deployments\Sachin-TradingEngineWS-WS\
WebServices\com\sachin\tradeengine\ws\Ping_Tie.java:57: ping(java.util.Date) in com.sachin.tradeengine.ws.Ping cannot be applied to (java.util.Calendar) _result = ((com.sachin.tradeengine.ws.Ping) getTarget()).ping
(myPing_Type.getDate_1());
^
1 error
04/03/23 17:17:35 Notification ==> Application Deployer for Sachin-TradingEngineWS-WS FAILED: java.lang.InstantiationException: Error compiling :E:\Oracle\oc4j1003\j2ee\home\applications\Sachin-TradingEngineWS-WS\WebServices: Syntax error in source [ 2004-03-23T17:17:35.937GMT+05:30 ]
I read somewhere that the conversion between java to xml datatype and vice versa fails for java.util.Date, so it is better to use java.util.Calendar. When I change the code to return a java.util.Calendar then the JDeveloper prompts me the following failure:
Method Ping: the following parameter types do not have an XML Schema mapping and/or serializer specified : java.util.Calendar.
This forces me to return a String data.
I would appreciate if someone can help me out.
Thanks
Sachin Mathias
Datamatics Ltd.Hi
I got the web service working with some work around. But I am not sure it this approach would be right and good.
I started altogether afresh. I did the following step :
1. Created an Interface (Ping.java) for use in web Service as follows :
public interface Ping extends Remote{
public java.util.Date ping(java.util.Date pingDateRequest)
throws RemoteException;
2. Implemented the above interface in PingImpl.java as follows :
public class PingImpl implements Ping
public java.util.Date ping(java.util.Date pingDateRequest) throws RemoteException {
System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
return pingDateRequest;
3. Compiled the above 2 java files.
4. Generated a Stateless Java Web Service with the help of JDeveloper. This time the generation was sucessful.(If I had "java.util.Calendar" in place of "java.util.Date" in the java code of the above mentioned files the web service generation would prompt me for error)
5. After the generation of Web Service, I made modification to the Ping interface and its implementing class. In both the files I replaced "java.util.Date" with "java.util.Calendar". The modified java will look as follows :
Ping.Java
=========
public interface Ping extends Remote{
public java.util.Calendar ping(java.util.Calendar pingDateRequest)
throws RemoteException;
PingImpl.Java
================
public class PingImpl implements Ping
public java.util.Calendar ping(java.util.Calendar pingDateRequest) throws RemoteException {
System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
return pingDateRequest;
6. Now I recompile both the java files.
7. Withour regenerating the Web Service I deploy the Web Service on OC4j 10.0.3 from JDeveloper. This time the deployment was sucessful.(The Deployment fails if I don't follow the step 5.)
8. Now I generated a Stub from JDeveloper and accessed the stub from a client. It works fine. Here if you see the Stub code it takes java.util.Date as a parameter and returns a java.util.Date. (Mind you I am accepting a java.util.Calendar and returning the same in my Web Service interface. Step 5)
The confusing thing is the Serialization and Deserialization of Data from Client java data to Soap message and Soap message to Server java data.
From Client to SOAP :
java.util.Date to datetime
From SOAP to Server :
datetime to java.util.Calendar
From Server to SOAP :
java.util.Calendar to datetime
From SOAP to Client :
datetime to java.util.Date (I am not able to understand this part of the conversion)
Any help or inputs would be appreciated.
Thanks
Sachin Mathias
Maybe you are looking for
-
Automatic generation for credit memo
Hi Experts , I have 2-main scenarios for vendor returns process : 1- Regular Scenario: a-Replacement the rejected goods after sending these goods back to the vendor(in this case the fresh goods will be received against the same P.O) b- creation of cr
-
External Hard Drive doesn't show particular folder
I have this weird issue with my hard disk. Have been using Seagate GoFlex 1 TB for quite some time, on Windows as well as on Mac. Recently I had copied a folder with lot of videos on Windows. But when I opened the Hard Disk on Mac, the folder was bla
-
T61 sudden shut down after I replaced the fan
I was getting a fan error (that was preventing the unit from booting), so I ordered a replacement. On installing it last night, everything seemed fine. Unit ran fine for 20m then Bam! sudden shutdown. This morning, same thing, both witht the battery
-
i trying to restore my iphone at the end of the process during restoring the device shows me the 1015 code error what i have to do now?
-
UWL application in Webdynpro Java
Hi I have a requirement where I need to replicate the standard SAP UWL feature in a custom Webdynpro Java component. The Webdynpro Java component will be a custom screen which will have all the features of the standard UWL. When the users launch the