[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apollo-dev
Subject:    How to pass Stream/ByteArray:webService (WSDLtoJAVA)
From:       "Sachin Sisodia" <sachin.sisodia () gmail ! com>
Date:       2007-03-14 1:35:15
Message-ID: acee60a50703131835w764b26a0hfa981b9acdfeb262 () mail ! gmail ! com
[Download RAW message or body]

Hi All,

I have written one java service in webMethods which is expecting input as a
stream. I am calling this java service as a web service from one java client
as follow:

public class wS_client {

            public static void chooseWS(Object input) {
                       ServiceServiceLocator aService=new
ServiceServiceLocator();
  try {

  ServiceBindingStub aStub=(ServiceBindingStub)aService.getservicePort0();
                                    String isOK=aStub.webServiceTest1
(input);
                                   System.out.println("Executed
OK?\t"+isOK);
                       } catch (Exception e) {
System.out.println("Exception-------------"+e.toString());
  }
            }
public static void main(String[] arg ){
String testString = "testing is going on";
ByteArrayInputStream input= new ByteArrayInputStream(testString.getBytes());
chooseWS (input);
}

But I am getting the following exception on runtime:

java.io.IOException: No serializer found for class
java.io.ByteArrayInputStream in registry
org.apache.axis.encoding.TypeMappingImpl@76fba0

I also tried to pass byte array as an input but it doesn't work. Should I
have to pass stream as a base64? Is there any other work around for this
problem.

 I would appreciate any help on the same.

Regards
Sachin

[Attachment #3 (text/html)]

<p>Hi All, </p>
<p>I have written one java service in webMethods which is expecting input as a \
stream. I am calling this java service as a web service from one java client as \
follow: </p> <p>public class wS_client {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static \
void chooseWS(Object input) {</p> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ServiceServiceLocator aService=new ServiceServiceLocator();</div> <div>&nbsp; try \
{</div> <p>&nbsp; ServiceBindingStub \
aStub=(ServiceBindingStub)aService.getservicePort0(); </p> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
String isOK=aStub.webServiceTest1(input);</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
System.out.println(&quot;Executed OK?\t&quot;+isOK);</div> \
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
} catch (Exception e) { </div> \
<div>System.out.println(&quot;Exception-------------&quot;+e.toString());&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
 <div>&nbsp; }</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>public static void main(String[] arg ){</div>
<div>String testString = &quot;testing is going on&quot;;</div>
<div>ByteArrayInputStream input= new \
ByteArrayInputStream(testString.getBytes());</div> <div>chooseWS (input);</div>
<div>}</div>
<div>&nbsp;</div>
<div>But I am getting the following exception on runtime:</div>
<div>&nbsp;</div>
<div>java.io.IOException: No serializer found for class java.io.ByteArrayInputStream \
in registry <a href="mailto:org.apache.axis.encoding.TypeMappingImpl@76fba0">org.apache.axis.encoding.TypeMappingImpl@76fba0</a></div>
 <div>&nbsp;</div>
<div>I also tried to pass byte array as an input but it doesn&#39;t work. Should I \
have to pass stream as a base64? Is there any other work around for this \
problem.</div> <div>&nbsp;</div>
<div>&nbsp;I would appreciate any help on the same.&nbsp;</div>
<div>&nbsp;</div>
<div>Regards</div>
<div>Sachin<br>&nbsp;</div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic