Microsoft grap: GetGroupFromIdS2SRequest. Workload MsGraph_DirectoryServices - windows

I have aproject project in Java. When I run the project I got a error: GetGroupFromIdS2SRequest. Workload MsGraph_DirectoryServices, Someone would said me how to fix it?.
SpringApplication.run(DemoApplication.class, args);
final ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder().clientId("xxxx").clientSecret("yyyy").tenantId("zzzz").build();
List<String> scope = new ArrayList<>();
scope.add("https://graph.microsoft.com/.default");
final TokenCredentialAuthProvider tokenCredentialAuthProvider = new TokenCredentialAuthProvider( scope, clientSecretCredential);
final GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider(tokenCredentialAuthProvider).buildClient();
GroupCollectionPage groupCollectionPage = graphClient.groups().buildRequest().get();
Group group = new Group();
group.description = "Group with designated owner and members207";
group.displayName = "Operations group207";
LinkedList<String> groupTypesList = new LinkedList<String>();
groupTypesList.add("Unified");
group.groupTypes = groupTypesList;
group.mailEnabled = false;
group.mailNickname = "operations207";
group.securityEnabled = true;
group.additionalDataManager().put("\"owners#odata.bind\"", new JsonPrimitive("[ \"https://graph.microsoft.com/v1.0/directoryObjects/11111111\"]"));
String sIdGrupo = graphClient.groups().buildRequest().post(group).id;
Team team = new Team();
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.allowCreateUpdateChannels = true;
team.memberSettings = memberSettings;
TeamMessagingSettings messagingSettings = new TeamMessagingSettings();
messagingSettings.allowUserEditMessages = true;
messagingSettings.allowUserDeleteMessages = true;
team.messagingSettings = messagingSettings;
TeamFunSettings funSettings = new TeamFunSettings();
funSettings.allowGiphy = true;
funSettings.giphyContentRating = GiphyRatingType.STRICT;
team.funSettings = funSettings;
graphClient.groups(sIdGrupo).team().buildRequest().put(team);

Before: Team team = new Team();, I added this line:
try {
sleep(30000);
} catch (InterruptedException e) {
e.printStackTrace();
}

Related

Calling an Oracle GlInterface SOAP service in .net Core

Error : System.ServiceModel.FaultException`1[Service.ServiceErrorMessage]: JBO-GL:::GL_INVALID_LEDGER: GL-781535You have entered an invalid ledger value. (Fault Detail is equal to Service.ServiceErrorMessage).
only result when I search
BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
EndpointAddress endpointAddress = new EndpointAddress(new Uri("https://fa-eosd-dev1-saasfaprod1.fa.ocs.oraclecloud.com:443/fscmService/JournalImportService?WSDL"));
ChannelFactory<JournalImportService> factory = new ChannelFactory<JournalImportService>(basicHttpBinding, endpointAddress);
factory.Credentials.UserName.UserName = "user";
factory.Credentials.UserName.Password = "pass";
JournalImportService serviceProxy = factory.CreateChannel();
((ICommunicationObject)serviceProxy).Open();
var opContext = new OperationContext((IClientChannel)serviceProxy);
var prevOpContext = OperationContext.Current; // Optional if there's no way this might already be set
OperationContext.Current = opContext;
importJournalsRequest importJournalsRequest = new importJournalsRequest();
GlInterfaceTransHeader glInterfaceTransHeader = new GlInterfaceTransHeader();
glInterfaceTransHeader.LedgerId = 300000001958365;
List<GlInterface> glInterface = new List<GlInterface>();
glInterface.Add(glInter);
glInterfaceTransHeader.GlInterface = glInterface.ToArray();
importJournalsRequest.interfaceRows = glInterfaceTransHeader;
try
{
var result = await serviceProxy.importJournalsAsync(importJournalsRequest);
//cleanup
factory.Close();
((ICommunicationObject)serviceProxy).Close();
}
catch (Exception ex)
{
throw ex;
}
finally
{
// *** ENSURE CLEANUP *** \\
CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory);
OperationContext.Current = prevOpContext; // Or set to null if you didn't capture the previous context
}
}
glInterfaceTransHeader.AccountingDateSpecified = true;

Response status code does not indicate success: '400' ('Bad request')

i want to POST data to API in my android xamarin app using refit i've tested the API at Postman and it's working fine but at android app i'm getting exception Bad request.
Here is my android code i added the interface and the model i don't know what is the problem .
public interface RequestAPI
{
[Post("/request")]
Task<create_request> submit([Body] create_request request);
}
requestAPI= RestService.For<RequestAPI>("http://courier-magconsulting.azurewebsites.net/api");
button.Click += async delegate
{
try
{
create_request request = new create_request();
request.PickUpPhone = "7664554";
request.DownPayment = 89;
request.DeliveryFees = 56.8;
request.Note = "i need a help!";
request.RequestID = 88; // replace the value yourself
request.DekiveryLocationLatitude = 2323;
request.DeliveryLocationLongitude = 232;
request.PickUpLocationLatitude = 898;
request.PickUpLocationLongitude = 1123;
BroadcastType type = new BroadcastType();
type.Name = "All";
type.ID = 60; // replace the value yourself
request.BroadcastType = type;
Cargosize size = new Cargosize();
size.Name = "Small";
size.ID = 1; // replace the value yourself
request.Cargosize = size;
Cargoweight weight = new Cargoweight();
weight.Name = "Large";
weight.ID = 2; // replace the value yourself
request.CargoWeight = weight;
Sender sender_ = new Sender();
sender_.Name = "Ahmad";
sender_.SenderID = 1; // replace the value yourself
sender_.Phone = "8788";
sender_.SocialID = "8787";
sender_.RatingAvg = 5;
SenderStatus status = new SenderStatus();
status.ID = 1;
status.Name = "Active";
sender_.Senderstatus = status;
request.Sender = sender_;
create_request result = await requestAPI.submit(request);
Toast.MakeText(this, "Request created", ToastLength.Long).Show();
}
catch(Exception ex)
{
Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
}
};

ShellTile not updating data on windows phone

I want to schedule multiple Tile Notifications while my app is running, so that when my app is in background, my schedule Tile notifications appear one by one using respective occurrence time.
But somehow when I schedule multiple (3) notifications only last one appears.
String message = "";
String key = "FamilyFarm" + count;
if (String.IsNullOrEmpty(duration) || String.IsNullOrEmpty(name))
return;
IsolatedStorageSettings setting = IsolatedStorageSettings.ApplicationSettings;
if (setting.Contains(key))
{
setting.Remove(key);
}
setting.Add(key, name);
count++;
ShellTileSchedule SampleTileSchedule = new ShellTileSchedule();
bool TileScheduleRunning = false;
// Update will happen one time.
SampleTileSchedule.Recurrence = UpdateRecurrence.Onetime;
// Start the update schedule now.
SampleTileSchedule.StartTime = DateTime.Now;
SampleTileSchedule.RemoteImageUri = new Uri(#"http://www.weather.gov/forecasts/graphical/images/conus/MaxT1_conus.png");
SampleTileSchedule.Start();
TileScheduleRunning = true;
ShellTile oTile = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("flip".ToString()));
if (oTile != null && oTile.NavigationUri.ToString().Contains("flip"))
{
FlipTileData oFliptile = new FlipTileData();
oFliptile.Title = name;
oFliptile.Count = 11;
oFliptile.BackTitle = key;
oFliptile.BackContent = name;
oFliptile.WideBackContent = name;
oFliptile.SmallBackgroundImage = new Uri("Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative);
oFliptile.BackgroundImage = new Uri("Assets/Tiles/FlipCycleTileLarge.png", UriKind.Relative);
oFliptile.WideBackgroundImage = new Uri("Assets/Tiles/Flip/FlipCycleTileLarge.png", UriKind.Relative);
oFliptile.BackBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative);
oFliptile.WideBackBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative);
oTile.Update(oFliptile);
// MessageBox.Show("Flip Tile Data successfully update.");
//return true;
}
else
{
// once it is created flip tile
Uri tileUri = new Uri("/MainPage.xaml?tile=flip", UriKind.Relative);
ShellTileData tileData = new FlipTileData()
{
Title = "Hello FamilyFarm",
BackTitle = key,
BackContent = name,
WideBackContent = name,
Count = 8,
SmallBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative),
BackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative),
WideBackgroundImage = new Uri("/Assets/Tiles/FlipCycleTileMedium.png", UriKind.Relative),
};
ShellTile.Create(tileUri, tileData, true);
}
If you want to see the Tile Cycle, you should use
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207036(v=vs.105).aspx
or
Creating CycleTile with remote images
Otherwise if you want to see the Update taking place you should put a Thread.Sleep or Task.Wait between updates to be able to see them.
When you want some cycling in WP7.8 you can use MangoPollo.

Magento SOAP V_2 creating order error: Payment not allowed

I am trying to create an order on Magento 1.7.2 using SOAP API V_2 using .NET consol.
I am always getting the same error "Payment not allowerd" using every payment method.
//create an order with Magento API
MagentoService proxy = new MagentoService();
string sessionId = proxy.login("xxx", "xxx");
int idCarrello = proxy.shoppingCartCreate(sessionId, "1");
proxy.UnsafeAuthenticatedConnectionSharing = false;
shoppingCartCustomerEntity clienteMagento = new shoppingCartCustomerEntity();
clienteMagento.firstname = "name";
clienteMagento.lastname = "surname";
clienteMagento.email = "xxx#mmmm.com";
clienteMagento.mode = "guest";
proxy.shoppingCartCustomerSet(sessionId, idCarrello, clienteMagento, "1");
shoppingCartCustomerAddressEntity indirizzoSpedizione = new shoppingCartCustomerAddressEntity();
shoppingCartCustomerAddressEntity indirizzoBill = new shoppingCartCustomerAddressEntity();
indirizzoSpedizione.mode = "shipping";
indirizzoSpedizione.firstname = clienteMagento.firstname;
indirizzoSpedizione.lastname = clienteMagento.lastname;
indirizzoSpedizione.street = "viale europa 32";
indirizzoSpedizione.city = "Foggia";
indirizzoSpedizione.region = "FG";
indirizzoSpedizione.telephone = "111";
indirizzoSpedizione.postcode = "71122";
indirizzoSpedizione.country_id = "IT";
indirizzoSpedizione.is_default_billing = 0;
indirizzoSpedizione.is_default_shipping = 0;
indirizzoBill.mode = "billing";
indirizzoBill.firstname = clienteMagento.firstname;
indirizzoBill.lastname = clienteMagento.lastname;
indirizzoBill.street = "viale europa 32";
indirizzoBill.city = "Foggia";
indirizzoBill.region = "FG";
indirizzoBill.telephone = "111";
indirizzoBill.postcode = "71122";
indirizzoBill.country_id = "IT";
indirizzoBill.is_default_billing = 0;
indirizzoBill.is_default_shipping = 0;
shoppingCartCustomerAddressEntity[] indirizzi = new shoppingCartCustomerAddressEntity[] { indirizzoSpedizione, indirizzoBill };
proxy.shoppingCartCustomerAddresses(sessionId, idCarrello, indirizzi, "1");
proxy.shoppingCartShippingMethod(sessionId, idCarrello, "flatrate_flatrate", "1");
shoppingCartPaymentMethodResponseEntity[] paymentMethods = proxy.shoppingCartPaymentList(sessionId, idCarrello, "1");
Console.WriteLine(paymentMethods); //paymentMethods is always empty!!
shoppingCartPaymentMethodEntity modoPagamento = new shoppingCartPaymentMethodEntity();
modoPagamento.po_number = null;
modoPagamento.method = "checkmo";
modoPagamento.cc_cid = null;
modoPagamento.cc_owner = null;
modoPagamento.cc_number = null;
modoPagamento.cc_type = null;
modoPagamento.cc_exp_year = null;
modoPagamento.cc_exp_month = null;
proxy.shoppingCartPaymentMethod(sessionId, idCarrello, modoPagamento, "1");
Here is the Exception:
//Payment method is not allowed (I tryed checkmo, banktransfer, etc)
//proxy.shoppingCartOrder(sessionId, idCarrello, "1", new string[] { });
Any idea?
Ifaced with the saeme issue. This is the solution - You forgot product, just add product to sale. Also you must do it according to this order (it will not works in other order):
shoppingCartCustomerSet(guest for simplicity);
shoppingCartCustomerAddresses();
shoppingCartProductAdd();
shoppingCartShippingMethod();
shoppingCartPaymentMethod();

Random Images in Wp7

I am making an application for windows phone in which i have to display random images whenever the new page is loaded...i am using the following code:-
private Random rand = new Random();
private Image GetRandomImage(string PastScannerResults)
{
string[] files = Directory.GetFiles("/PastScanner/Results");
int i = rand.Next(files.Length);
return Image.FromFile(files[i]);
}
but not getting the results:-(
Please suggest something..Thanks in Advance.
Directory.GetFiles is the syntax for XBOX.
In order to work with files on WP7 you need to use isolated storage.
Something like this should work:
IsolatedStorageFile userFile = IsolatedStorageFile.GetUserStoreForApplication();
var files = userFile.GetFileNames();
Random r = new Random();
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile(files[r.next(0,files.count], FileMode.Open, FileAccess.Read))
{
bi.SetSource(fileStream);
this.img.Height = bi.PixelHeight;
this.img.Width = bi.PixelWidth;
}
this.img.Source = bi;
public void image_random()
{
List<string> pics = new List<string>()
{
"Assets/1.jpg",
"Assets/2.jpg",
"Assets/3.jpg",
"Assets/4.jpg",
"Assets/5.jpg",
"Assets/6.jpg",
"Assets/7.jpg",
"Assets/8.jpg",
"Assets/9.jpg",
"Assets/10.jpg",
"Assets/11.jpg",
"Assets/12.jpg",
"Assets/13.jpg",
"Assets/14.jpg",
"Assets/15.jpg"
};
Random rnd = new Random();
ImageBrush brush1 = new ImageBrush();
brush1.ImageSource = new BitmapImage(new Uri(pics[rnd.Next(0, 7)],
UriKind.Relative));
ImageBrush brush2 = new ImageBrush();
brush2.ImageSource = new BitmapImage(new Uri(pics[rnd.Next(0, 7)],
UriKind.Relative));
img.Source = brush1.ImageSource;
img1.Source = brush2.ImageSource;
}

Resources