BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-05-2009, 09:01 AM   #1
v2vboni
New Member
 
Join Date: May 2009
Model: 7100T
PIN: N/A
Carrier: VIVA
Posts: 1
Default HELP on SOAP HTTP post

Please Login to Remove!

Guys, I'm new to programming but I have given a tasked about HTTP post with SOAP.


Currently I have this web service to use:


POST /admin/mmwlapi/webmm.asmx/RegWebMMToken HTTP/1.1
Host: 217.69.181.57
Content-Type: application/x-www-form-urlencoded
Content-Length: length

token=string&msisdn=string&timeout=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<MmwlApiResult xmlns="the http address">
<ErrorCode>int</ErrorCode>
<Result>string</Result>
</MmwlApiResult>



Now I have this CODE:


@Jpf.Action(forwards = {
@Jpf.Forward(name = "success",
path = "cmm_Main.jsp")
}
)
protected Forward begin()
{


Customer customer = (Customer)getRequest().getSession().getAttribute(" customer");
getRequest().getSession().setAttribute("MSISDN",cu stomer.getMSISDN());
//getRequest().getSession().setAttribute("MSISDN",cu stomer.getMSISDN().substring(3));




//msisdn
//String sMobileMM = (String)getRequest().getSession().getAttribute("Mo bileMM");
String sMobileMM = "96566363909";
String eMobileMM1 = CustomerCodeEncryption.encrypt(sMobileMM);
getRequest().getSession().setAttribute("eMobileMM" ,eMobileMM1);

//token
String sToken = (String)getRequest().getSession().getAttribute("eM obileMM");
String eToken1 = CustomerCodeEncryption.encrypt(sToken);
getRequest().getSession().setAttribute("eToken",eT oken1);


try
{

System.out.println("Signing in...");


URL url = new URL("The http URL address/RegWebMMToken?token=<%=session.getAttribute("eToke n")%>&msisdn=<%=session.getAttribute("eMobileWMM") %>&timeout=30&lang=<%=session.getAttribute("LOCALE ")%>");
URLConnection urlc = url.openConnection();
urlc.setRequestProperty("Content-Type","text/xml");
urlc.setDoOutput(true);
urlc.setDoInput(true);
System.out.println("Getting output stream\n");
PrintWriter pw = new PrintWriter(urlc.getOutputStream());
System.out.println("request sent\n");
urlc.connect();


BufferedReader in = new BufferedReader(new InputStreamReader(urlc.getInputStream()));
String inputLine;
String str = new String();

//Parse response. If no error, should return boolean true
while ((inputLine = in.readLine()) != null) {
//System.out.println(inputLine);
str += inputLine;
}

System.out.println(str);

}

catch (Exception e) {
System.out.println("Error: "+e.getMessage());
e.printStackTrace();
}

return new Forward("success");
}

}



I want to get the result from the HTTP post if the result is success or not If success I want to forward it to cmm_Main.jsp page.


How can I correct my code here.. .Please help


thank you.l
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Schneider Electric Inverter ATV 320 5.5kW ATV320U55N4B New picture

Schneider Electric Inverter ATV 320 5.5kW ATV320U55N4B New

$798.00



New Schneider Inverter ATV930D11N4 Frequency Converter picture

New Schneider Inverter ATV930D11N4 Frequency Converter

$1050.00



New Original Inverter Schneider ATV630D37N4 In Sealed Fast  Via DHL picture

New Original Inverter Schneider ATV630D37N4 In Sealed Fast Via DHL

$2210.00



New in box Siemens Inverter Siemens 6SE6420-2UD27-5CA1 7.5KW 6SE6 420-2UD27-5CA1 picture

New in box Siemens Inverter Siemens 6SE6420-2UD27-5CA1 7.5KW 6SE6 420-2UD27-5CA1

$669.00



VEVOR 7.5KW 10HP Variable Frequency Drive Inverter Convert 1 To 3 Phase VFD 220V picture

VEVOR 7.5KW 10HP Variable Frequency Drive Inverter Convert 1 To 3 Phase VFD 220V

$159.99



Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD VSD picture

Single To 3 Phase 7.5KW 10HP 220V Variable Frequency Drive Inverter CNC VFD VSD

$169.90







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.